It is from John P. Logsdon's book "Programming 2D Scrolling Games in 2005 as it used purebasic 3.93 and I have fixed most of the code for Purebasic 4.51....
So far....
Chapter 3 - Hello World - Done
Chapter 4 - Hello World2 - Done
Chapter 5 - Loop - Done
Chapter 6 - Arrays - Nearly Done ..Just one Code to fixed
Chapter 7 - Arrays Struct - Nearly Done...Just one code to fixed
Chapter 8 - Memory - Done
Chapter 9 - Procedure - Not Done
Chapter 10 - File 0/1 - Not Done
Chapter 11 - 2D Graphics - Done
Chapter 12 - Sprites - Not Done
Chapter 13 - Sprite Anim - Done
Chapter 14 - Collisions - Not Done
Chapter 15 - Inputs - Not Done
Chapter 16 - Sounds - Not Done
Chapter 17 - Timer - Not Done
Chapter 19 - ZOrdering - Done
Chapter 20 - Map - Not Done
This is Chapter 6 - ex6-5VariableLengths.pb
I try to correct it but it wont run

Code: Select all
; Initialize the sprite and keyboard systems and a 640x480, 16-bit screen
If InitSprite() = 0 Or InitKeyboard() = 0 Or OpenScreen(640,480,16,"Array Test") = 0
MessageRequester("Error!", "Unable to Initialize Environment", #PB_MessageRequester_Ok)
End
EndIf
; Set up the vertical control variable
TextY = 0
; set up our flag value for seeing if we're done or not
FinishedListing = 0
Restore NameData
StartDrawing(ScreenOutput())
; while we're NOT finished
While FinishedListing = 0
; read a name from the data segment
Read Name.s
; if that name = STOP, then we're done
If Name = "STOP"
FinishedListing = 1
Else
; otherwise, show the name we read
DrawText(0,TextY,Name)
TextY = TextY + 16
EndIf
Wend
; display a message so the user knows how to exit
DrawText(0,400,"Press any key to exit")
StopDrawing()
FlipBuffers() ;show the output to the user
; wait for any key to be pressed
Repeat
ExamineKeyboard()
Until KeyboardReleased(#PB_Key_All)
End ; end the program
; Here is our data area
DataSection
NameData:
Data.s "John","Joe","Mark","George"
Data.s "Sally","Betty","Lorelei","Anne"
Data.s "Fido","Spot","Killer","Tank"
Data.s "Millennium Hawk","Tea Fighter","Zap-Wing","Dead Star"
Data.s "STOP"
EndDataSection