Spécial ! |
Version mobile de l'aldweb Site m.aldweb.com Ni Français, ni Anglais ?Essayez donc l'un de ces drapeaux :
|
|
Météo / Spam / www |
Météo Lyon
aldweb contre le SPAM
|
|
|
|
|
|
|
- Forum - iziBasic
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257
Sujet n° 1567 |
Full Version Dim Understanding |
le 01/08/2007 @ 18:15 par Larry Martin
|
Would anyone tell why I cannot get the following code to compile?
{CREATORID "MyLM"} {VERSION "2.0"}
dim %form1$ dim %prompt1$ dim %max% const %max%=50 CONST %form1$ = " ## ####" CONST %prompt1$ = "<1> Next <2> Exit"
begin dim %numsber%(%max%) dIM %dist%(%max%) end |
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1 -------- le 02/08/2007 @ 02:13 par JoeV
visiteur |
Hello Larry,
The 2 errors I see are:
- Dim cannot be declared in the program body, only before the begin statement.
- Arrays must be declared as dim A(n) for numbers, or dim A$(n) for strings, where n is an integer, not a variable.
Try something like:
dim A(50) dim A$(50) dim %form1$ dim %prompt1$ dim %max% const %max%=50 CONST %form1$ = " ## ####" CONST %prompt1$ = "<1> Next <2> Exit"
begin
'Program here
end
Regards,
JoeV
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2 -------- le 02/08/2007 @ 20:32 par Larry Martin
visiteur |
Joe thanks for the help! But I'm still having problems with one part of the code as I've listed. Do appreciate your help!
' iNew1.ibas {CREATORID "DLML"} {VERSION "2.0"}
dim %form1$ dim %prompt1$ dim %max% const %max%=50 DIM %numsber%(%max%) ' When I add (%max%) I nannot compile CONST %form1$ = " ## ####" CONST %prompt1$ = "<1> Next <2> Exit"
begin print %prompt1$ wait end
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3 -------- le 03/08/2007 @ 02:34 par Larry Martin
visiteur |
by Larry Martin 02/08/2007 @ 20:32
Joe thanks for the help! But I'm still having problems with one part of the code as I've listed. Do appreciate your help!
' iNew1.ibas {CREATORID "DLML"} {VERSION "2.0"}
dim %form1$ dim %prompt1$ dim %max% const %max%=50 DIM %numsber%(%max%) ' When I add (%max%) I cannot compile CONST %form1$ = " ## ####" CONST %prompt1$ = "<1> Next <2> Exit"
begin print %prompt1$ wait end
|
|
|
Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 4 -------- le 03/08/2007 @ 03:12 par JoeV
visiteur |
Hello Larry,
In IziBasic you cannot create a numerical array named %numsber% of size %max%. Arrays can only be named a or A. So you must replace DIM %numsber%(%max%) with dim a(50). In your program, however, you can retrieve the value a(%max%). Read 'arrays' in the manual. Also, read appendix #9 to understand how IziBasic stores the values.
Hope this helps.
JoeV |
|
|
sujet actif
sujet clos
Important!
Nouveau message -
Rectifier message
Clôturer sujet
Remonter
|
|
|
|
|
|