|
Post by badbug on Jul 3, 2023 5:57:06 GMT -5
For a prime example of a Basic Programing language which became arthritic, check out 'Power Basic'. Thanks for the hint on Power Basic. I thought it was dead. Power Basic 10 is their latest release. Anyway, I tried it and wrote a web application that supported multiple clients. Was simple to write and it worked. I tried something simple for the first try and did the following; Read a person table from mySQL. I wanted something small. It only had about 40,000 persons. 1. Display the person info at 20 persons per page in a html <table>. 2. At the top of html was buttons for [exit] quit, [srch] search, [prev] go to previous page, [next] go to next page, and page number field to jump to any page. 3. The heading of the <table> displayed the name of the field. If any field is selected it sorts the person file by that field. 4. Each line had buttons to [add], [change], or [delete]. when selected it displayed a detail of that person back so the client user could change any detail. with add - it added a person like the one selected. 5. If you select [srch] it displays a detail form so you can enter what you want to search for in multiple columns. Even wild card searches like ab* to fine everything that begins with ab. *ab to find everything that ends in ab. *ab* the field contains ab in it somewhere. Soundix for fields that sound like ab. What was interesting is that it does not require a server such as Apache, or IIS. It has all the TCP/IP routines needed in the program. I already had this written in Run Basic, so it didn't take much to convert it. Thanks again for the heads up. The user community seems to be fairly active.
|
|
|
Post by Mark Dunham on Feb 7, 2024 20:30:07 GMT -5
I am getting Syntax error -, #simcity, "background background_brown". I modified a few lines so far and they no longer throw a syntax error but before I spent a few days reworking something that worked, I figured I would ask. I have included my original source code that works with Pro 4.5.1.
open "SimCity" for graphics_nf_nsb as #simcity #simcity background("background_brown") *Updated Code Snippet
#simcity drawsprites() *Updated Code Snippet 'SimCity Redo TEST 'Mark Dunham 'February 21, 2016 10:14PM
nomainwin WindowWidth = 800 WindowHeight = 600 UpperLeftX = int((DisplayWidth - WindowWidth)/2) UpperLeftY = int((DisplayHeight - WindowHeight)/2)
'LOAD BITMAPS loadbmp "roadH", "Sprites\Road_H.bmp" loadbmp "roadV", "Sprites\Road_V.bmp" loadbmp "road4W", "Sprites\Road_4Way.bmp" loadbmp "roadT1", "Sprites\Road_Turn1.bmp" loadbmp "roadT2", "Sprites\Road_Turn2.bmp" loadbmp "roadT3", "Sprites\Road_Turn3.bmp" loadbmp "roadT4", "Sprites\Road_Turn4.bmp" loadbmp "roadI1", "Sprites\Road_Intersection1.bmp" loadbmp "roadI2", "Sprites\Road_Intersection2.bmp" loadbmp "roadI3", "Sprites\Road_Intersection3.bmp" loadbmp "roadI4", "Sprites\Road_Intersection4.bmp" loadbmp "residential", "Sprites\Residential.bmp" loadbmp "commercial", "Sprites\Commercial.bmp" loadbmp "industrial", "Sprites\Industrial.bmp" loadbmp "powerline4W", "Sprites\PowerLines_4Way.bmp" loadbmp "background_brown", "Sprites\BackGround_Brown.bmp"
tileSelected$ = " " previousTileSelected$ = " "
button #simcity.roadsbtn, "Roads", [Roads], UL, 675,5,100,25 button #simcity.buildingsbtn, "Buildings", [Buildings], UL, 675,30,100,25 button #simcity.powerLinesbtn, "PowerLines", [PowerLines], UL, 675,55,100,25
open "SimCity" for graphics_nf_nsb as #simcity #simcity, "background background_brown" #simcity, "drawsprites" #simcity, "when characterInput [keyboardInput]" #simcity, "when mouseMove [mouseMove]" #simcity, "when leftButtonDown [leftMouseClick]" #simcity, "trapclose [simcity.quit]" #simcity, "setfocus"
dim road$(1000) dim roadX(1000) dim roadY(1000) dim buildings$(1000) dim buildingX(1000) dim buildingY(1000) dim powerlines$(1000) dim powerlinesX(1000) dim powerlinesY(1000) roadCount = 0 buildingCount = 0 powerlineCount = 0 unit = 32
[simcityMain] timer 50, [simcityLoop] wait
[simcityLoop] goto[simcityMain] wait
[keyboardInput] if len(Inkey$) = 2 then key = asc(right$(Inkey$,1)) else key = 0 char$ = Inkey$ if char$ = "b" then gosub[buildAgain] Inkey$ = "" wait
[mouseMove] scan if tileSelected$ = "H_Road" then #simcity, "spritexy roadH "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "V_Road" then #simcity, "spritexy roadV "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "4W_Road" then #simcity, "spritexy road4W "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "T1_Road" then #simcity, "spritexy roadT1 "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "T2_Road" then #simcity, "spritexy roadT2 "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "T3_Road" then #simcity, "spritexy roadT3 "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "T4_Road" then #simcity, "spritexy roadT4 "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "I1_Road" then #simcity, "spritexy roadI1 "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "I2_Road" then #simcity, "spritexy roadI2 "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "I3_Road" then #simcity, "spritexy roadI3 "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "I4_Road" then #simcity, "spritexy roadI4 "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "Residential" then #simcity, "spritexy residential "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "Commercial" then #simcity, "spritexy commercial "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "Industrial" then #simcity, "spritexy industrial "; MouseX; " "; MouseY #simcity, "drawsprites" end if if tileSelected$ = "PowerLine_4Way" then #simcity, "spritexy powerline4W "; MouseX; " "; MouseY #simcity, "drawsprites" end if wait
[leftMouseClick] if tileSelected$ = "H_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadH" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadH" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadH" #simcity, "drawsprites" end if if tileSelected$ = "V_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadV" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadV" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadV" #simcity, "drawsprites" end if if tileSelected$ = "4W_Road" then roadCount = roadCount + 1 road$(roadCount) = "road4W" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " road4W" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite road4W" #simcity, "drawsprites" end if if tileSelected$ = "T1_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadT1" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadT1" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadT1" #simcity, "drawsprites" end if if tileSelected$ = "T2_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadT2" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadT2" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadT2" #simcity, "drawsprites" end if if tileSelected$ = "T3_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadT3" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadT3" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadT3" #simcity, "drawsprites" end if if tileSelected$ = "T4_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadT4" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadT4" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadT4" #simcity, "drawsprites" end if if tileSelected$ = "I1_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadI1" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadI1" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadI1" #simcity, "drawsprites" end if if tileSelected$ = "I2_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadI2" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadI2" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadI2" #simcity, "drawsprites" end if if tileSelected$ = "I3_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadI3" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadI3" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadI3" #simcity, "drawsprites" end if if tileSelected$ = "I4_Road" then roadCount = roadCount + 1 road$(roadCount) = "roadI4" + str$(roadCount) #simcity, "addsprite "; road$(roadCount); " roadI4" roadX(roadCount) = int(MouseX/unit)*unit roadY(roadCount) = int(MouseY/unit)*unit #simcity, "spritexy "; road$(roadCount); " "; roadX(roadCount); " "; roadY(roadCount) tileSelected$ = " " #simcity, "removesprite roadI4" #simcity, "drawsprites" end if if tileSelected$ = "Residential" then buildingCount = buildingCount + 1 buildings$(buildingCount) = "residential" + str$(buildingCount) #simcity, "addsprite "; buildings$(buildingCount); " residential" buildingX(buildingCount) = int(MouseX/unit)*unit buildingY(buildingCount) = int(MouseY/unit)*unit #simcity, "spritexy "; buildings$(buildingCount); " "; buildingX(buildingCount); " "; buildingY(buildingCount) tileSelected$ = " " #simcity, "removesprite residential" #simcity, "drawsprites" end if if tileSelected$ = "Commercial" then buildingCount = buildingCount + 1 buildings$(buildingCount) = "commercial" + str$(buildingCount) #simcity, "addsprite "; buildings$(buildingCount); " commercial" buildingX(buildingCount) = int(MouseX/unit)*unit buildingY(buildingCount) = int(MouseY/unit)*unit #simcity, "spritexy "; buildings$(buildingCount); " "; buildingX(buildingCount); " "; buildingY(buildingCount) tileSelected$ = " " #simcity, "removesprite commercial" #simcity, "drawsprites" end if if tileSelected$ = "Industrial" then buildingCount = buildingCount + 1 buildings$(buildingCount) = "industrial" + str$(buildingCount) #simcity, "addsprite "; buildings$(buildingCount); " industrial" buildingX(buildingCount) = int(MouseX/unit)*unit buildingY(buildingCount) = int(MouseY/unit)*unit #simcity, "spritexy "; buildings$(buildingCount); " "; buildingX(buildingCount); " "; buildingY(buildingCount) tileSelected$ = " " #simcity, "removesprite industrial" #simcity, "drawsprites" end if if tileSelected$ = "PowerLine_4Way" then powerlineCount = powerlineCount + 1 powerlines$(powerlineCount) = "powerline4W" + str$(powerlineCount) #simcity, "addsprite "; powerlines$(powerlineCount); " powerline4W" powerlinesX(powerlineCount) = int(MouseX/unit)*unit powerlinesY(powerlineCount) = int(MouseY/unit)*unit #simcity, "spritexy "; powerlines$(powerlineCount); " "; powerlinesX(powerlineCount); " "; powerlinesY(powerlineCount) tileSelected$ = " " #simcity, "removesprite powerline4W" #simcity, "drawsprites" end if wait
[H_Road] tileSelected$ = "H_Road" previousTileSelected$ = "H_Road" #simcity, "addsprite roadH roadH" close #roads wait
[V_Road] tileSelected$ = "V_Road" previousTileSelected$ = "V_Road" #simcity, "addsprite roadV roadV" close #roads wait
[4W_Road] tileSelected$ = "4W_Road" previousTileSelected$ = "4W_Road" #simcity, "addsprite road4W road4W" close #roads wait
[T1_Road] tileSelected$ = "T1_Road" previousTileSelected$ = "T1_Road" #simcity, "addsprite roadT1 roadT1" close #roads wait
[T2_Road] tileSelected$ = "T2_Road" previousTileSelected$ = "T2_Road" #simcity, "addsprite roadT2 roadT2" close #roads wait
[T3_Road] tileSelected$ = "T3_Road" previousTileSelected$ = "T3_Road" #simcity, "addsprite roadT3 roadT3" close #roads wait
[T4_Road] tileSelected$ = "T4_Road" previousTileSelected$ = "T4_Road" #simcity, "addsprite roadT4 roadT4" close #roads wait
[I1_Road] tileSelected$ = "I1_Road" previousTileSelected$ = "I1_Road" #simcity, "addsprite roadI1 roadI1" close #roads wait
[I2_Road] tileSelected$ = "I2_Road" previousTileSelected$ = "I2_Road" #simcity, "addsprite roadI2 roadI2" close #roads wait
[I3_Road] tileSelected$ = "I3_Road" previousTileSelected$ = "I3_Road" #simcity, "addsprite roadI3 roadI3" close #roads wait
[I4_Road] tileSelected$ = "I4_Road" previousTileSelected$ = "I4_Road" #simcity, "addsprite roadI4 roadI4" close #roads wait
[Residential] tileSelected$ = "Residential" previousTileSelected$ = "Residential" #simcity, "addsprite residential residential" close #buildings wait
[Commercial] tileSelected$ = "Commercial" previousTileSelected$ = "Commercial" #simcity, "addsprite commercial commercial" close #buildings wait
[Industrial] tileSelected$ = "Industrial" previousTileSelected$ = "Industrial" #simcity, "addsprite industrial industrial" close #buildings wait
[4Way_PowerLine] tileSelected$ = "PowerLine_4Way" previousTileSelected$ = "PowerLine_4Way" #simcity, "addsprite powerline4W powerline4W" close #powerlines wait
[buildAgain] if previousTileSelected$ = "H_Road" then tileSelected$ = "H_Road" #simcity, "addsprite roadH roadH" end if if previousTileSelected$ = "V_Road" then tileSelected$ = "V_Road" #simcity, "addsprite roadV roadV" end if if previousTileSelected$ = "4W_Road" then tileSelected$ = "4W_Road" #simcity, "addsprite road4W road4W" end if if previousTileSelected$ = "T1_Road" then tileSelected$ = "T1_Road" #simcity, "addsprite roadT1 roadT1" end if if previousTileSelected$ = "T2_Road" then tileSelected$ = "T2_Road" #simcity, "addsprite roadT2 roadT2" end if if previousTileSelected$ = "T3_Road" then tileSelected$ = "T3_Road" #simcity, "addsprite roadT3 roadT3" end if if previousTileSelected$ = "T4_Road" then tileSelected$ = "T4_Road" #simcity, "addsprite roadT4 roadT4" end if if previousTileSelected$ = "I1_Road" then tileSelected$ = "I1_Road" #simcity, "addsprite roadI1 roadI1" end if if previousTileSelected$ = "I2_Road" then tileSelected$ = "I2_Road" #simcity, "addsprite roadI2 roadI2" end if if previousTileSelected$ = "I3_Road" then tileSelected$ = "I3_Road" #simcity, "addsprite roadI3 roadI3" end if if previousTileSelected$ = "I4_Road" then tileSelected$ = "I4_Road" #simcity, "addsprite roadI4 roadI4" end if if previousTileSelected$ = "Residential" then tileSelected$ = "Residential" #simcity, "addsprite residential residential" end if if previousTileSelected$ = "Commercial" then tileSelected$ = "Commercial" #simcity, "addsprite commercial commercial" end if if previousTileSelected$ = "Industrial" then tileSelected$ = "Industrial" #simcity, "addsprite industrial industrial" end if if previousTileSelected$ = "PowerLine_4Way" then tileSelected$ = "PowerLine_4Way" #simcity, "addsprite powerline4W powerline4W" end if wait
[Roads] WindowWidth = 400 WindowHeight = 500 UpperLeftX = 150 UpperLeftY = 50
bmpbutton #roads.roadHbtn, "Buttons\RoadH_Button.bmp", [H_Road], UL, 168, 10 bmpbutton #roads.roadVbtn, "Buttons\RoadV_Button.bmp", [V_Road], UL, 210, 10 bmpbutton #roads.road4Wbtn, "Buttons\Road4W_Button.bmp", [4W_Road], UL, 168, 47 bmpbutton #roads.roadT1btn, "Buttons\RoadT1_Button.bmp", [T1_Road], UL, 168, 84 bmpbutton #roads.roadT2btn, "Buttons\RoadT2_Button.bmp", [T2_Road], UL, 210, 84 bmpbutton #roads.roadT3btn, "Buttons\RoadT3_Button.bmp", [T3_Road], UL, 210, 121 bmpbutton #roads.roadT4btn, "Buttons\RoadT4_Button.bmp", [T4_Road], UL, 168, 121
bmpbutton #roads.roadI1btn, "Buttons\RoadI1_Button.bmp", [I1_Road], UL, 168, 158 bmpbutton #roads.roadI2btn, "Buttons\RoadI2_Button.bmp", [I2_Road], UL, 210, 158 bmpbutton #roads.roadI3btn, "Buttons\RoadI3_Button.bmp", [I3_Road], UL, 168, 195 bmpbutton #roads.roadI4btn, "Buttons\RoadI4_Button.bmp", [I4_Road], UL, 210, 195
open "Roads" for dialog_nf_modal as #roads #roads, "trapclose [roads.quit]"
wait
[Buildings] WindowWidth = 400 WindowHeight = 500 UpperLeftX = 150 UpperLeftY = 50
bmpbutton #buildings.resbtn, "Buttons\Res_Button.bmp", [Residential], UL, 168, 10 bmpbutton #buildings.combtn, "Buttons\Com_Button.bmp", [Commercial], UL, 168,47 bmpbutton #buildings.indbtn, "Buttons\Ind_Button.bmp", [Industrial], UL, 168, 84
open "Buildings" for dialog_nf_modal as #buildings #buildings, "trapclose [buildings.quit]"
wait
[PowerLines] WindowWidth = 400 WindowHeight = 500 UpperLeftX = 150 UpperLeftY = 50
bmpbutton #powerlines.PLHbtn, "Buttons\PowerLines4W_Button.bmp", [4Way_PowerLine], UL, 168,10
open "Power Lines" for dialog_nf_modal as #powerlines #powerlines, "trapclose [powerlines.quit]"
wait
[roads.quit] close #roads wait
[buildings.quit] close #buildings wait
[powerlines.quit] close #powerlines wait
[simcity.quit] close #simcity end
|
|
|
Post by Carl Gundel on Feb 13, 2024 8:31:27 GMT -5
Hello Mark How about running some file compare (like winDiff) on Lb4 version and tweaked Lb5 version, And make a post like "To make program run in Lb5, I had to make these changes:" ? I think that would be helpful. I do have it diffed but there are a lot of changes that I had to do and I know space on the forum is at a premium. But I think I can cover them all in a simple post.
First I had to remove the "," from in from of my windoe handle there a few windows so don't forget them as well
- #simcity, "setfocus" 'OLD VERSION LB4
- #simcity "setfocus" 'NEW VERSION LB5
I also had to change my windows from "dialog_nf_Modal" to "dialog_modal" - open "Roads" for dialog_nf_modal as #roads 'OLD VERSION LB4
- #roads, "trapclose [roads.quit]" 'OLD VERSION LB4
- open "Roads" for dialog_modal as #roads 'NEW VERSION LB5
- #roads "trapclose [roads.quit]" 'NEW VERSION LB5
Be careful not to remove the comma from bmpbutton I got a little zealous and did that myself LOL. I hope this helps I can do the diff as well but didn't want to get to crazy. Thanks Mark. I will actually fix those things so that the incompatibilities disappear, and other things too as much as possible. -Carl
|
|