TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: BRIAN MCLAUGHLIN
date: 1996-02-14 21:51:00
subject: Compiler quirk?

Here is a conundrum I just ran across, where the PB32 compiler isn't
compiling quite as I would expect. Consider this code...
 FOR test% = 1 TO 3
   IF test% = 3 THEN test% = -333: test% = 999
   PRINT test%
 NEXT test%
The quirk is in the colon that separates the IF statement from
the LET statement (test% = 999). I would expect the compiler to
treat this code as equivalent to this...
 FOR test% = 1 TO 3
   IF test% = 3 THEN test% = -333
   test% = 999
   PRINT test%
 NEXT test%
But, instead, the compiler compiles it as the equivalent of this...
 FOR test% = 1 TO 3
   IF test% = 3 THEN
     test% = -333
     test% = 999
   END IF
   PRINT test%
 NEXT test%
Am I just all wet, or am I onto something here? How do others think
the compiler should behave in this instance? Inquiring minds want to
know.
Brian M.
 * SLMR 2.1a * MAXLIB For PB v1.2 - Access arrays and files in EMS/XMS!
--- WILDMAIL!/WC v4.12 
---------------
** A related thread FOLLOWS this message.

FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC   Ref: D2QK0499 Date: 02/21/96
From: KURT KUZBA                                            Time: 04:08pm
\/To: BRIAN MCLAUGHLIN                                    (Read 3 times)
Subj: R: Compiler quirk?

BM>   Here is a conundrum I just ran across, where the PB32
BM>   compiler isn't compiling quite as I would expect. Consider
BM>   this code...
BM>   FOR test% = 1 TO 3
BM>     IF test% = 3 THEN test% = -333: test% = 999
BM>     PRINT test%
BM>   NEXT test%
BM>   I would expect
BM>   FOR test% = 1 TO 3
BM>     IF test% = 3 THEN test% = -333
BM>     test% = 999
BM>     PRINT test%
BM>   NEXT test%
BM>  Am I just all wet, or am I onto something here?
bm>........................................................
   You are onto code block formatting.
FOR test% = 1 TO 3
   IF test% = 3 THEN
      test% = -333: test% = 999
   END IF
   '_|_|_|   IF test% = 3 THEN test% = -333: test% = 999
   '_|_|_|   This is the equivalent statement in single line form
   PRINT test%
NEXT
   For convenience, where the code is not excessive of a line,
the END IF is implied at the end of the line, and you do not need
to create three lines of code where a single line would serve.

---
> ] By tomorrow, this will all seem like a dream................

---------------
>>>>>>>>>>>>>>>>>>>>>> LAST Message In Thread <<<<<<<<<<<<<<<<<<<<<<

FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC   Ref: D2K00002 Date: 02/15/96
From: JAMES GOLDBLOOM                                       Time: 06:30am
\/To: JUSTIN ECKBLAD                                      (Read 3 times)
Subj: Re: Using Asm Code

 JE-> Well thats why I also suggested him doing it as FUNCTION. :)
Possibly...  (smile)...
He thinks (and so do I) you mean the ANSI print function from PBWIZ routine
which calls an external file (and other routines such a .BMP, .GIF, etc.)
so could you please post an example of how to successfully save a screen,
in what format, and how to make it so the standalone .EXE displays it?
Thanks kindly, we'd all like to see methods on displaying internalized
screens, called on demand, in the program.  (Regardless of the 4k memory loss
per screen, bearing in mind, we know the limitations also...)
Maybe a snippet from your favorite program utilizing your method?  How about
using TDRAW 4.0 to create them?  Which save method do you recommend/use?
-James (SysOp/AD Message System)
--- QuickBBS 2.80 GoldBase (Zeta-1)
---------------
* Origin: Com-Dat BBS - Hillsboro, OR. HST DS (1:105/314.0)
* Origin: AD Message BBS/10th Year Online! (703)241-1826 (1:109/611@FIDONET)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.