aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1564

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1564  Replacement for a Const (Constant)

26/07/2007 @ 03:45
by Larry

Anonymous



I've been trying out the trial for izibasic
and found out const are not used,
I've tried about every way I know with
the following code in a Dim format with
no luck

CONST PROGNAME$ = " Larry Martin"

Thank You for your Help
Write to Larry   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
26/07/2007 @ 14:22
by aldweb

Anonymous

visitor
Hello Larry,

To use DIM, a full version of iziBasic is required.
So a source code with a full version of iziBasic would look like:
DIM %PROGNAME$ 'a custom variable in iziBasic requires a starting % character
CONST %PROGNAME$="Larry Martin"
BEGIN
PRINT %PROGNAME$
WAIT
END

With the trial version of iziBasic, you may still work with constants, but using the standard A$-Z$ variables:
CONST P$="Larry Martin"
BEGIN
PRINT P$
WAIT
END

Why use a CONST then? when one could do:
BEGIN
P$="Larry Martin"
PRINT P$
WAIT
END


In this case, the compiler will store the "Larry Martin" string in the memory, and copy its value to P$ only at runtime. So the string is stored twice.
In the previous case, at compilation time, the string is directly stored in P$.

Cheers,
aldweb
Write to aldweb   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^