REM Opens notepad, then I want the text in open.txt to display in qb64CHDIR "C:\Documents and settings\all users"SHELL "open.txt"
Screen 12 PRINT " This my text explaining this pitchure" PRINT "And so one, but if there are several lines of text" Print " This is not very convient." _ Loadimage ,syntex follows _putimage , syntex follows Next CLS ' More text and images
DEFLNG A-ZSCREEN _NEWIMAGE(640, 480, 32)CLSmaxlines& = 0ThisFile% = FREEFILE 'get next free file handle must be integerOPEN "message.txt" FOR INPUT AS #ThisFile%DO INPUT #ThisFile%, temp$ maxlines& = maxlines& + 1LOOP WHILE NOT EOF(ThisFile%)temp$ = "" 'dump contents of stringCLOSE #ThisFile%LOCATE 1, 20PRINT "There are "; maxlines&; " in this file + here they are"maxlines& = 0ThisFile% = FREEFILE 'get next free file handle must be integerOPEN "message.txt" FOR INPUT AS #ThisFile%DO INPUT #ThisFile%, temp$ maxlines& = maxlines& + 1 LOCATE maxlines& + 2, 1 PRINT temp$LOOP WHILE NOT EOF(ThisFile%)temp$ = "" 'dump contents of stringCLOSE #ThisFile%SLEEPSYSTEM
DEFLNG A-ZSCREEN _NEWIMAGE(640, 480, 32)WorkPage& = _LOADIMAGE("NEWGHOST_blu1.png")CLSGOSUB MakPhrases 'get the amount of lines so we can make a dim to gather themIF maxlines& <> 0 THEN DIM Phrases$(maxlines&) GOSUB FillDim 'read individual phrases into the string dimELSE PRINT "File not found": _DELAY 3: ENDEND IF_DELAY .5_DEST 0Textprn$ = "Hello World !!!": RRow% = 2: CColumn% = 6: z% = 0: Pause! = .5GOSUB ShowtextGOSUB PickphraseRRow% = 15: CColumn% = 20: z% = 0: Pause! = .050DO FOR x = 0 TO 261 STEP 67 _PUTIMAGE (100, 100)-(220, 190), WorkPage&, 0, (x, 0)-(x + 67, 67) _DELAY .08 NEXT GOSUB Showtext LOCATE RRow%, CColumn% PRINT STRING$(Length%, 32) LOCATE 25, 4 PRINT " press + hold escape to exit" GOSUB PickphraseLOOP UNTIL _KEYDOWN(27)SYSTEMEND'--------------------------------------------------------------------------Showtext:z% = 0Length% = LEN(Textprn$)FOR a = 1 TO Length% LOCATE RRow%, CColumn% + z% PRINT MID$(Textprn$, a, 1) z% = z% + 1 _DELAY Pause!NEXT aRETURNMakPhrases:maxlines& = 0ThisFile% = FREEFILE 'get next free file handle must be integerOPEN "message.txt" FOR INPUT AS #ThisFile%DO INPUT #ThisFile%, temp$ maxlines& = maxlines& + 1LOOP WHILE NOT EOF(ThisFile%)temp$ = "" 'dump contents of stringCLOSE #ThisFile%RETURNFillDim:maxlines& = 0ThisFile% = FREEFILE 'get next free file handle must be integerOPEN "message.txt" FOR INPUT AS #ThisFile%DO INPUT #ThisFile%, temp$ Phrases$(maxlines&) = temp$ maxlines& = maxlines& + 1LOOP WHILE NOT EOF(ThisFile%)temp$ = "" 'dump contents of stringCLOSE #ThisFile%RETURNPickphrase:Whatone% = INT(RND * maxlines&) 'make a random number to select exact phraseTextprn$ = Phrases$(Whatone%)RETURN
LOCATE 25, 4 PRINT " press + hold escape to exit" GOSUB PickphraseLOOP UNTIL _KEYDOWN(27)SYSTEMEND
LOCATE 24, 4 PRINT " press + hold escape to exit" LOCATE 25, 4 PRINT "Use page down to move to next page,pageup to move back to the previous" GOSUB PickphraseLOOP UNTIL _KEYDOWN(27)SYSTEMEND
PRINT STRING$(Length%, 32)
DEFLNG A-ZSCREEN _NEWIMAGE(640, 480, 32)WorkPage& = _LOADIMAGE("NEWGHOST_blu1.png")CLSGOSUB MakPhrases 'get the amount of lines so we can make a dim to gather themIF maxlines& <> 0 THEN DIM Phrases$(maxlines&) GOSUB FillDim 'read individual phrases into the string dimELSE PRINT "File not found": _DELAY 3: ENDEND IF_DELAY .5_DEST 0Textprn$ = "Hello World !!!": RRow% = 2: CColumn% = 6: z% = 0: Pause! = .5: Whatone% = 0GOSUB ShowtextGOSUB PickphraseRRow% = 15: CColumn% = 20: z% = 0: Pause! = .050DO FOR x = 0 TO 261 STEP 67 _PUTIMAGE (100, 100)-(220, 190), WorkPage&, 0, (x, 0)-(x + 67, 67) _DELAY .08 NEXT GOSUB Showtext SLEEP LOCATE RRow%, CColumn% PRINT STRING$(Length%, 32) LOCATE 25, 4 PRINT " press + hold escape to exit or any key to contimue" GOSUB PickphraseLOOP UNTIL _KEYDOWN(27)SYSTEMEND'--------------------------------------------------------------------------Showtext:z% = 0Length% = LEN(Textprn$)FOR a = 1 TO Length% LOCATE RRow%, CColumn% + z% PRINT MID$(Textprn$, a, 1) z% = z% + 1 _DELAY Pause!NEXT aRETURNMakPhrases:maxlines& = 0ThisFile% = FREEFILE 'get next free file handle must be integerOPEN "message.txt" FOR INPUT AS #ThisFile%DO INPUT #ThisFile%, temp$ maxlines& = maxlines& + 1LOOP WHILE NOT EOF(ThisFile%)temp$ = "" 'dump contents of stringCLOSE #ThisFile%RETURNFillDim:maxlines& = 0ThisFile% = FREEFILE 'get next free file handle must be integerOPEN "message.txt" FOR INPUT AS #ThisFile%DO INPUT #ThisFile%, temp$ Phrases$(maxlines&) = temp$ maxlines& = maxlines& + 1LOOP WHILE NOT EOF(ThisFile%)temp$ = "" 'dump contents of stringCLOSE #ThisFile%RETURNPickphrase:Whatone% = Whatone% + 1IF Whatone% > maxlines& - 1 THEN Whatone% = 1Textprn$ = Phrases$(Whatone%)RETURN