10 December 2020, 18:59 | #1 |
Registered User
Join Date: Apr 2013
Location: .
Posts: 267
|
Function Vs Statement?
Which is better as are both the same?
I did the function and run the program but it is crash the system! So frustrating |
10 December 2020, 19:56 | #2 |
Registered User
Join Date: Nov 2018
Location: Frankfurt, Germany
Posts: 5
|
Could you show the code?
Gesendet von meinem Mi Note 10 Lite mit Tapatalk |
10 December 2020, 19:58 | #3 |
Banana
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,217
|
|
10 December 2020, 23:00 | #4 |
Registered User
Join Date: Apr 2013
Location: .
Posts: 267
|
Ahhh Right, When I used Statement to show Circle or Square on the screen by using Statement(once I understand on how work then I will be using it more!)
Code:
Screen 0,0,0,320,200,3,0,"Welcome Blitz 2",1,2,0 Statement Draw_Everythings{} Bitmap 0,320,200,3 Circlef 160,100,50,3 mousewait End Statement Draw_Everythings{} End |
11 December 2020, 10:25 | #5 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
|
The Statement/Function thing doesn't look like it's the issue in your code. What error are you getting in the debugger? It looks like you're trying to open a screen with a bitmap that doesn't exist yet. Try moving the Bitmap command out of the statement and before the screen command.
|
11 December 2020, 18:55 | #6 | |
Registered User
Join Date: Apr 2013
Location: .
Posts: 267
|
Quote:
Code:
Bitmap 0,320,200,3 Screen 0,0,0,320,200,3,0,"Welcome Blitz 2",1,2,0 Statement Draw_Everythings{} Circlef 160,100,50,3 mousewait End Statement Draw_Everythings{} End Code:
Open Screen While Press Escape Move_Ball{} Move_Bat{} Print_Score{} wend End |
|
11 December 2020, 23:42 | #7 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
|
I've just tested this, and the first code does give errors with the debugger running ("Uninitialised Bitmap"). You should always run the debugger while you're testing new code, because it'll catch many issues like that and give you hints about the issue instead of letting the system crash.
Moving the Bitmap command to the top lets it work just fine, and the program structure looks good to me |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blitz] re-dim arrays inside statement/function | peceha | Coders. Blitz Basic | 7 | 24 June 2020 13:10 |
Forward statement or function | Nightshft | Coders. Blitz Basic | 5 | 17 April 2020 01:02 |
for..each statement in CLI | pieter1976 | support.Other | 10 | 09 January 2020 22:15 |
Share NewType to Statement/Function | earok | Coders. Blitz Basic | 21 | 30 May 2018 13:37 |
Hyperion Statement on litigation with Amiga Inc. | Ultron | News | 2 | 02 May 2007 11:06 |
|
|