English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   support.AmigaOS (https://eab.abime.net/forumdisplay.php?f=142)
-   -   AmigaDos Help Needed (https://eab.abime.net/showthread.php?t=113731)

pngcan 23 February 2023 17:51

AmigaDos Help Needed
 
Hello friends
I am trying to create a small loader project file for a game I created.
I need it to check how much Chip Ram is available as the game requires a 2mb Chip Ram Amiga. I used to be pretty proficient with AmigaDos some 20 - 25 years ago but alas I am just relearning it all again now in my retirement.
This is what I have:
Assign -----etc
Avail chip
If count GT 1048576
Echo "2mb Amiga Model"
Wait 2
(game load file)
Else
Echo "Sorry, the game requires a 2mb Chip Ram Amiga to Play"
Wait 3
Quit
End If
It works fine on my 1200 being it has 2mb chip ram, but when I go in and change the 1mb to over 2mb in line 3 to test it still loads the game, it should go to the Else and indicate it needs 2mb chip ram and quit, but it does not.
What am I doing wrong here? Thanks in advance for any help
Paul

Nor Bert 23 February 2023 19:13

You didn't specify how the numerical value was passed to "count"

paul1981 23 February 2023 22:53

Assign blah...
IF VAL `C:AVAIL CHIP` NOT GT 1048576
"Sorry, the game requires a 2mb Chip Ram Amiga to Play"
Wait 3
Quit
EndIF
Echo "2mb Amiga Model"
Wait 2
(game load file)

Alt and that top left key on the Amiga (below escape) for those reverse apostrophes.

pngcan 23 February 2023 23:01

Quote:

Originally Posted by paul1981 (Post 1598563)
Assign blah...
IF VAL `C:AVAIL CHIP` NOT GT 1048576
"Sorry, the game requires a 2mb Chip Ram Amiga to Play"
Wait 3
Quit
EndIF
Echo "2mb Amiga Model"
Wait 2
(game load file)

Alt and that top left key on the Amiga (below escape) for those reverse apostrophes.

Ahhh, of course Paul, Val instead of count, as Nor Bert indicated I didn't specify how Avail goes to count, don't need to that with the Val command. Thanks kindly friend.

paul1981 23 February 2023 23:47

No trouble at all. VAL is part of IF, it just tells IF to expect a numerical value for the comparison (GT in your case).


All times are GMT +2. The time now is 05:31.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04282 seconds with 11 queries