Page 1 of 2
Please help
Posted: Sun Feb 01, 2015 3:37 pm
by dE.niz
Hello
What is wrong here, I can not find the solution in the manual.
Please help Smart Basic is a great app but the manual is not a very helpful assistance.
Sorry for the bad words.
rem button
button "push" title "Druk toets "at 100,250 size 230,80
do
if button_pressed("push")then graphics clear
if "push" = 1 then break
until "push" < 1
dE.niz
Re: Please help
Posted: Sun Feb 01, 2015 3:41 pm
by Mr. Kibernetik
Please explain what you want to get from your program, for each and every line.
Re: Please help
Posted: Sun Feb 01, 2015 3:54 pm
by Dutchman
dE.niz wrote:
Please help Smart Basic is a great app but the manual is not a very helpful assistance.
Sorry for the bad words.
You are right, that remark is very unfriendly.
The manual is NOT a tutor on programming.
You'll have to learn what variables are and much much more.
Start reading examples and try to change certain things.
And keep in mind that nobody is obliged to give you an answer.
Re: Please help
Posted: Sun Feb 01, 2015 5:51 pm
by Dutchman
Maybe this could be a starter for you
Code: Select all
rem button
REM Comments by Dutchman
REM the first two lines make sense, the rest is 'bagger' in Dutch
button "push" title "Druk toets "at 100,250 size 230,80
do
/*
if button_pressed("push")then graphics clear
>>> "push" is a 'string' and NOT a variable
>>> you could use 'push' as a variable
if "push" = 1 then break
until "push" < 1
*/
REM you did not give the command GRAPHICS
REM so the program is in TEXT view
IF BUTTON_PRESSED("push") THEN TEXT CLEAR
PAUSE 0.1
PRINT "?";
UNTIL 0 ' keep doing
END 'a program should have a proper END
Re: Please help
Posted: Sun Feb 01, 2015 6:03 pm
by dE.niz
Hello
The program is just a learning test. Nothing special.
I 'm trying to understand the examples.
I have a little experience for basic programming. I know wat variables and strings are.
And yes i have a book to learn basic.
Here is my test program.
rem graphics mode
graphics
graphics clear 1,1,1
rem blauwe rand
rem ld= line size
ld=10
draw size ld
draw color 0,0,1
draw rect 20,20 to 745,960
rem titel
draw font name "courier-bold"
draw font size 100
draw color 1,.4,.5
draw text "Titel."at 100,100
draw line 100,210 to 400,210
rem knop
button "push" title "Druk toets "at 100,250 size 230,80
do
if button_pressed("push")then graphics clear rem why brackets around the name ("push")
if "push"= 1 then break
until "push"< 1
Sorry for the bad words it will not happen again
I just want some help.
Thank you Mr Kibernetik.
Re: Please help
Posted: Sun Feb 01, 2015 6:10 pm
by Dutchman
… and thanks Dutchman
Re: Please help
Posted: Sun Feb 01, 2015 6:21 pm
by Mr. Kibernetik
Dutchman wrote:… and thanks Dutchman
Yes, thank you Dutchman! And thank you Henko!
Here BUTTON is the
command:
Code: Select all
button "push" title "Druk toets "at 100,250 size 230,80
Here BUTTON_PRESSED() is the
function, this is why it has brackets:
Code: Select all
if button_pressed("push")then graphics clear
Functions always have brackets, commands does not. BASIC programming language uses both functions and commands.
I cannot understand what do you want to get from this code:
Code: Select all
if "push"= 1 then break
until "push"< 1
Re: Please help
Posted: Sun Feb 01, 2015 6:31 pm
by dE.niz
I'm very sorry Dutchman i didnt see your post.
I feel so stupid.
dE.niz
Re: Please help
Posted: Sun Feb 01, 2015 7:43 pm
by dE.niz
rem knop
button "push" title "Druk toets "at 100,250 size 230,80
do
if button_pressed("push")then graphics clear
if "push"= 1 then break
until "push" <1
The program is not finished.
If button_pressed ("push")then graphics clear rem clear the page when button is pressed
I just want a empty page.
If "push" =1 then break Just go out the loop by 1
Thank you
Re: Please help
Posted: Sun Feb 01, 2015 7:48 pm
by Mr. Kibernetik
Then you can make it like this:
Code: Select all
1 IF BUTTON_PRESSED("push") == 0 THEN 1
GRAPHICS CLEAR
In first line it cycles while button "push" is not pressed.
Second line is continuation of the program.