Can somebody please tell me what this command is doing ?!?

A forum for anything about the Steem Engine STE emulator, comments, problems, bug reports etc. Steven Seagal regularly provides updated versions of the original STEem code. The current version is v3.9.4.

Moderators: Mug UK, Steem Authors, Moderator Team

vodkasoda
Atari maniac
Atari maniac
Posts: 94
Joined: Wed Jul 07, 2010 3:55 pm

Can somebody please tell me what this command is doing ?!?

Postby vodkasoda » Fri Jul 23, 2010 3:39 pm

Simple enough question I hope !!!

I have a program that reads a file full of numbers and I *think* this variable (Inj_set%) is always 0 or -1, it certainly is in this particular file, but this file is recreated over & over again, so maybe it's not always 0 or -1 !!!

The command is

Code: Select all

If Inj_set% = Set


Anybody ?

User avatar
rocket-dog
Atari Super Hero
Atari Super Hero
Posts: 779
Joined: Wed Mar 05, 2008 3:13 pm
Location: Great Britain - The Kingdom of Mercia

Re: Can somebody please tell me what this command is doing ?

Postby rocket-dog » Fri Jul 23, 2010 5:13 pm

Um. I can't help you with your problem directly. But instead of speculating what value that variable is why don't you write a routine that rights the value away to a simple file then you won't have to speculate? It seems to be something programmers who have grown up at the PC end of the computing rarely think to do. On the large systems I used to work on where we had files flying between lots of boxes during a day's processing techniques like this saved us a lot of head scratching. Just a thought.

vodkasoda
Atari maniac
Atari maniac
Posts: 94
Joined: Wed Jul 07, 2010 3:55 pm

Re: Can somebody please tell me what this command is doing ?

Postby vodkasoda » Fri Jul 23, 2010 5:31 pm

Well I've just used some Print Commands and Stop Commands to see what the program is doing ... and I unfortunately got my original fields mixed up, which wouldn't have helped anybody, these are not the 0 or -1 values !!! The values for this field are always (in this run anyway), 1,3, 4 or 6 and whenever it is equal to 1 then the command is found to be true. So I'm now going to try a small file of the numbers 0-99 and see if it is still only when it is equal to 1 that the command is deemed to be true.

If that is the case then I will assume that the command

Code: Select all

If Inj_set% = Set
means

Code: Select all

If Inj_set% = 1
... which is not only clearer but shorter to code in the first place :roll: !!!

Thanks for answering rocket-dog, but as you can see, whilst I have done a similar process to what you suggested, it still leaves me speculating that that is what the command actually *really* does !!! I have a manual which I downloaded called the GFA Basic Manual, but it's 19 years old & this variation on the IF command isn't mentioned at all, so if anybody can point me at a newer / better manual, that would be appreciated :cheers:

User avatar
nativ
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4106
Joined: Mon Jul 30, 2007 10:26 am
Location: South West, UK

Re: Can somebody please tell me what this command is doing ?

Postby nativ » Fri Jul 23, 2010 5:47 pm

you might find something about this use in the advanced GFA guide, I don't have mine handy to run off details, they were available from 16/32 for £4 once.... Keep your eye out for a copy! goes into recursion and loads of mad features!

Cheers
Atari STFM 512 / STe 4MB / Mega ST+DSP / Falcon 4MB 16Mhz 68882 - DVD/CDRW/ZIP/DAT - FDI / Jaguar / Lynx 1&2 / 7800 / 2600 / XE 130+SD Card // Sega Dreamcast / Mega2+CD2 // Apple G4

http://soundcloud.com/nativ ~ http://soundcloud.com/nativ-1 ~ http://soundcloud.com/knot_music
http://soundcloud.com/push-sounds ~ http://soundcloud.com/push-records

User avatar
daeghnao
Captain Atari
Captain Atari
Posts: 479
Joined: Wed Oct 27, 2004 12:41 pm
Location: York, UK
Contact:

Re: Can somebody please tell me what this command is doing ?

Postby daeghnao » Fri Jul 23, 2010 11:17 pm

It's common practice in software engineering to assign symbolic names to constants. So, I imagine that somewhere in your program something defines "Set" to be 1. We do this so that it's easier to recognise the meaning of the value in terms of whatever the program's overall effect is. It makes the program easier to read, especially if you go away from it and come back later, or if many different people need to work on the program. If you have dozens of different types with several different possible values of each of them, just using the raw numbers would be extremely tiresome and error-prone. The only downsides I can see is that it takes extra disk space to store, extra time to build and requires you to think a little bit if you're ever faced with the raw number without the accompanying symbol.

Quite what's going on in your program though, I'm not sure - we'd have to see the whole thing to really be able to comment.

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2442
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Can somebody please tell me what this command is doing ?

Postby lp » Sat Jul 24, 2010 3:44 am

vodkasoda wrote:I have a manual which I downloaded called the GFA Basic Manual, but it's 19 years old & this variation on the IF command isn't mentioned at all, so if anybody can point me at a newer / better manual, that would be appreciated :cheers:


You can grab my OCR'ed copy of the GFA v3.6 manual here:
http://gfa.atari-users.net/ftp/download ... abasic.hyp

It contains a section on "IF/ENDIF". You'll need ST-Guide to view it though.

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2531
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: Can somebody please tell me what this command is doing ?

Postby charles » Sat Jul 24, 2010 4:52 am

i would just leave it be
put "set" back where it was
because later on in the program something could make set an other value
and in conjuction to the
"if inkjet%=set"part of program

in your new version only checks to see if its 1
and in the original program will find the value set into "set"

just place a
print "larrydairyes"
~inp(2)
under the if inkjet%
part so you can manually trace the program flow

if it goes there the program prints larry dairies and the holts until a keypress is pressed


set is probally not a constant but from what i been learning
magic numbers suck,

anyhow set could be changed to be a flag using the ! symbol in gfa , if its value is true or false

its easier to follow when things get more familiar or until you your self know their meaning.

its easier to follow when it has a meaning.

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

vodkasoda
Atari maniac
Atari maniac
Posts: 94
Joined: Wed Jul 07, 2010 3:55 pm

Re: Can somebody please tell me what this command is doing ?

Postby vodkasoda » Sat Jul 24, 2010 6:58 am

Thanks for your help and suggestions everybody, I'll continue to check this out but I can't initially see anywhere where SET is set as a variable to be equal to 1, though I can see where it is being used as a counter in a loop, why oh why do some people find it so difficult to use unique names throughout their program :x ?!?!?!?

Ip, thanks, I've downloaded that, now I have to find out how to read it :) !!!

Edit : This appears to do the trick : http://frankrueger.dnsalias.net/old_hom ... nguide.zip


Social Media

     

Return to “Steem”

Who is online

Users browsing this forum: No registered users and 2 guests