It is currently Tue Jun 27, 2017 7:07 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: PAUSE syntax errors
Unread postPosted: Sat Apr 29, 2017 9:57 am 
Offline

Joined: Wed Apr 15, 2015 3:57 am
Posts: 450
I was occasionally getting​ intermittent Syntax errors on PAUSE 100

A workaround which seems ok is to encapsulate the pause in a function:

FN.DEF wait()
Pause 100
FN.END

I wonder somewhat if this possibly has an added benefit of speeding up the parsing a bit.


Top
 Profile  
 
 Post subject: Re: PAUSE syntax errors
Unread postPosted: Tue Jun 13, 2017 4:42 pm 
Offline

Joined: Wed Oct 03, 2012 9:53 am
Posts: 2802
Location: Colorado, U.S.
Chris, can you post code that gets a syntax error on PAUSE? I can't even image a way the parser could screw up something that simple.
(But that's debugging, for you -- it constantly proves me wrong!)

- Marc


Top
 Profile  
 
 Post subject: Re: PAUSE syntax errors
Unread postPosted: Thu Jun 15, 2017 1:28 am 
Offline

Joined: Wed Apr 15, 2015 3:57 am
Posts: 450
Marc-
I will try to reproduce it again but it only seemed to do it in my calorie counting app but that was before I discovered I had some misplaced extra ENDIFs (if-then-endif or if-then-else-endif). it was very erratic. I will compile another test version with the pause statements back in line and some funky ENDIFs and see if the symptom comes back.

Chris


Top
 Profile  
 
 Post subject: Re: PAUSE syntax errors
Unread postPosted: Thu Jun 15, 2017 1:54 am 
Offline

Joined: Wed Apr 15, 2015 3:57 am
Posts: 450
I was just playing around now with some other apps and was wondering why this doesn't flag a misplaced ENDIF

Code:
fn.def render()
! All on one line
if !background() then gr.render else pause 100 endif
fn.end


Or
Code:
fn.def render()
if !junk then
if !background() then gr.render else pause 100 endif
endif
fn.end


Top
 Profile  
 
 Post subject: Re: PAUSE syntax errors
Unread postPosted: Sun Jun 25, 2017 2:31 pm 
Offline

Joined: Wed Apr 15, 2015 3:57 am
Posts: 450
Here is a simple app I started working on today-- It's just a simple voice clipboard
The PAUSE 100 sometimes chokes but I am not sure if it only seems to sometimes do it when the BASIC! app is running also in the background?

Bizarre...

Code:

REM Start of BASIC! Program
REM voxclip by mookiebearapps


FN.DEF appendln(f$,m$)
TEXT.OPEN a,h,f$
TEXT.WRITELN h,m$
TEXT.CLOSE h
FN.END

FN.DEF writeln(f$,msg$)
TEXT.OPEN w,hh,f$
TEXT.WRITELN hh,msg$
TEXT.CLOSE hh
FN.END

FN.DEF asklist$(l,msg$,c)
DIALOG.SELECT c, l, msg$
LIST.GET l,c,s$
FN.RTN s$
FN.END


FN.DEF listen$()

STT.LISTEN "speak"

STT.RESULTS v
LIST.SIZE v,n
IF n>1
  msg$="pick correct phrase"
  c$=asklist$(v,msg$,c)
ELSE
  LIST.GET v,1,c$
ENDIF
IF c$="cancel" THEN FN.RTN ""
FN.RTN c$
FN.END

! main

LIST.CREATE s,menu
! load items
loop:

FILE.EXISTS e,"clips.txt"
IF e
GRABFILE i$,"clips.txt"
i$=TRIM$(i$)
ENDIF
UNDIM ii$[]
SPLIT ii$[],i$,"\n"
ARRAY.LENGTH n,ii$[]

LIST.CLEAR menu
! show menu


LIST.ADD menu,"voice add","clear","exit"
FOR I=1 TO n
IF ii$[I]<>""
  LIST.ADD menu,TRIM$(ii$[I])
ENDIF
NEXT

msg$="VoxClip: choose one"
choice$=asklist$(menu,msg$,c)

IF choice$="clear"
writeln("clips.txt","")
ELSEIF choice$="exit"
EXIT
ELSEIF choice$="voice add"
s$=listen$()
IF s$<>""
  appendln("clips.txt",s$)
ENDIF
ELSE
CLIPBOARD.PUT choice$
POPUP choice$+" copied"
HOME
DO
  PAUSE 100
UNTIL !BACKGROUND()
ENDIF

GOTO loop




Top
 Profile  
 
 Post subject: Re: PAUSE syntax errors
Unread postPosted: Mon Jun 26, 2017 8:46 am 
Offline

Joined: Wed Apr 15, 2015 3:57 am
Posts: 450
Also not sure if running Nicolas' compiler in the background makes a difference.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
suspicion-preferred