[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

289.0. "GFA - Restore (value?)" by EUCLID::PAULHUS (Chris @ MLO8-3/T13 dtn 223-6871) Tue Nov 08 1988 14:29

	I'm working with GFA Basic V 2.01?  (not 3.xx)  I am trying to Read
  data after calculating a value that is equal to it's label.  

	Q.  How do I convert the calculated value to a label so the Read
  statement will work?

	Example:

  104:
	Data .03,.06,.12
  105:
	Data .04,.08,.17
  Rdx = Int(Ddiam/2) + 100    <-- This sets Rdx = a value like 104
  Restore Rdx         <--  This doesn't work.  Read wants a label like "104"
  For I = 1 to 3
    Read Db(5,I)  
  Next I

  I've tried variations on this like: Rdx% = Int(Dim/2 + 100)
		                      Restore Rdx%
                         Goto Rdx
			Goto Rdx%
	etc.   
  I gotta change the calculated value of Rdx into a label somehow to make
 this approach work.  I don't want to do it crudely, like

	If Rdx = 104            ------------------------------
	  Restore 104                                1 unit
	Endif                  _______________________________
	If Rdx = 105
	  Restore 105
	Endif
	etc, etc. (about 80 units of this stuff!, [80 Data labels])

  GFA Wizards, HELP!    - Chris
T.RTitleUserPersonal
Name
DateLines
289.1VINO::BHAMILTONBuzz HamiltonTue Nov 08 1988 14:449
    I don't have GFA Basic, but...
    
    It appears that the RESTORE statement wants a string as a parameter.
    Most BASICs have a function to convert numeric to string.
    How about RESTORE STR$(rdx) ?
    If it won't take any variable (only literal) then the only solutions
    I can think of are multiple restore statements with a case-type
    selection or self-modifying code where the program somehow modifies
    that line.
289.2:-( I'm afraid not :-(ELIS01::MAASSENFrans Maassen ELIS/ASG, NijmegenWed Nov 09 1988 10:176
    I've had a similar problem and I believe that it can't be done...
    I think you'll have to test on the contents of the variable
    and then use a literal to jump to the label. :-(
    
    I'dd wish it could be done (would make live easier)
    Frans
289.3Doesn't answer your question, but...LEDDEV::WALLACEWed Nov 09 1988 12:2711
    Well I'm another one who doesn't use GFA basic, I don't use basic
    at all, but...
    
    You did mention "...this approach..." so possibly you've already
    considered the following approach, but in case you haven't -
    Why not read all your data into an array (is that the only way to
    init an array in basic?) and then use Ddiam/2 as an index into the
    array? Actualy it would be a two dimensionial array since for each
    Ddiam/2 you want access to three floating point numbers.
    
    	Ray
289.4Thanks for replysENGINE::PAULHUSChris @ MLO8-3/T13 dtn 223-6871Thu Nov 10 1988 14:198
    re. .1    Buzz, It would seem that STR$ (Rdx) should work according
    to the description in the reference manual, but it doesn't.  (That
    was the first thing I tried.)
    re. .2  Frans,  thanks for the confirmation of the problem.  I was
    starting to think I was getting senile/dumb/something.
    re. .3  Ray,  Sounds like it should work.  Kinda a kludge, but maybe
    the best I can do.  
    			Thanks all,  - Chris