Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

68k Calculator Basic => TI-BASIC
Author Message
Kyo

Newbie

Joined: 15 Mar 2007
Posts: 3

 Posted: 15 Mar 2007 12:21:18 pm    Post subject: Hi People I want to write some code but I got a problem with the solve() function, what I got is this: test() Prgm Local a,b,c,d,e Dialog Request "a",a Request "b",b Request "c",c DropDown "solve for", {"a","b","c"},d EndDlog expr(a)->a expr(a)->b expr(a)->c if d=1 Then solve(m=n*(1+p)/o|m=a and p=b and o=c,n)->e Disp e End If EndPrgm And it fails on solve( with "Argument must be a variable name" What am I doing wrong? Help! PD: Excuse my Engrish
frenchcalc1
جان ألعريم

Active Member

Joined: 14 Mar 2007
Posts: 648

 Posted: 15 Mar 2007 02:33:15 pm    Post subject: shouldn't this be in the 68K programming section?Last edited by Guest on 15 Mar 2007 02:38:40 pm; edited 1 time in total
alexrudd
pm me if you read this

Bandwidth Hog

Joined: 06 Oct 2004
Posts: 2335

 Posted: 15 Mar 2007 04:06:32 pm    Post subject: I don't know anything about 68k basic, but would defining n before you try to use it change anything? EDIT: Or maybe not defining it. Try delvar n or whatever.Last edited by Guest on 15 Mar 2007 04:41:25 pm; edited 1 time in total
IAmACalculator
In a state of quasi-hiatus

Know-It-All

Joined: 21 Oct 2005
Posts: 1571

 Posted: 15 Mar 2007 05:01:13 pm    Post subject: @alexrudd: No, it would not. The [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]n tells the solver which variable to solve for. @kyo: You did [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]expr(a)->a expr(a)->b expr(a)->c which should be [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]expr(a)->a expr(b­)->b expr(c­)->c though I don't think that would cause your problems. Do you mind if I neaten your code a bit? I'm not sure if it'd help, but it's worth a try. [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]test() Prgm Local a,b,c,d,e Dialog Request "a",a,0 Request "b",b,0 Request "c",c,0 DropDown "solve for", {"a","b","c"},d EndDlog If d=1 Then Pause solve(expr(a)=n*(1+expr(b­))/expr(c­),n) ClrIO DispHome EndIf EndPrgm If the [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]requests don't work, just take off the "[font="courier new;font-size:9pt;line-height:100%;color:darkblue"],0" at the end. It disables alpha-lock in later versions of TI-OS (at least, I think it's later versions.) Out of curiosity, what kind of calculator do you have?Last edited by Guest on 15 Mar 2007 05:23:56 pm; edited 1 time in total
Kyo

Newbie

Joined: 15 Mar 2007
Posts: 3

 Posted: 15 Mar 2007 05:18:06 pm    Post subject: @IAmACalculator Thanks for the input, but I got the same err message(It's driving me nuts) BTW I got a Voyage. In the expr(a)->a,b,c was just a copy/paste problem :blush: and for the ",0" It work but the voyage don't need this. Again thanks dude for the input.
IAmACalculator
In a state of quasi-hiatus

Know-It-All

Joined: 21 Oct 2005
Posts: 1571

 Posted: 15 Mar 2007 05:25:08 pm    Post subject: I'm at my wit's end then. You localized all your variables, and it works perfectly on mine. Sorry, dude.
Kyo

Newbie

Joined: 15 Mar 2007
Posts: 3

 Posted: 15 Mar 2007 05:49:37 pm    Post subject: Ok, I found the problem, in the "Local" I also had "n", I delete it and work! Thanks, you save my day!!
IAmACalculator
In a state of quasi-hiatus

Know-It-All

Joined: 21 Oct 2005
Posts: 1571

 Posted: 15 Mar 2007 07:39:09 pm    Post subject: No problem, though I don't see what I did to help.
 Display posts from previous: All Posts Oldest FirstNewest First
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

»
 Page 1 of 1 » All times are GMT - 5 Hours