Ok the idea of using a showscreen between createscreens doesn't seem to make any difference. Using a different usescreen value though works. I used a global variable and then toggled the screen with it for WebOS:-
FUNCTION printsprite:pstext$,psfont%
LOCAL sentence$[],word$,fontw%,fonth%
SETFONT psfont
GETFONTSIZE fontw,fonth
pstext$=pstext$+" "
WHILE pstext$<>""
word$=pstext$
WHILE LEN(word$,1)>targetx OR RIGHT$(word$,1)<>" "
word$=LEFT$(word$,LEN(word$)-1)
WEND
DIMPUSH sentence$[],TRIM$(word$)
pstext$=LTRIM$(MID$(pstext$,LEN(word$)))
WEND
LOCAL pssprite%=GENSPRITE()
LOCAL myscreen%=9
?IFDEF WEBOS
webosscr=1-webosscr
INC myscreen,webosscr
?ENDIF
CREATESCREEN myscreen,pssprite,targetx,fonth*LEN(sentence$)
USESCREEN myscreen
LOCAL itemno=0
FOREACH item$ IN sentence$[]
PRINT item$,(targetx/2)-(LEN(item$,1)/2),fonth*itemno,1
INC itemno
NEXT
USESCREEN -1
RETURN pssprite
ENDFUNCTION
Ok, so that workaround worked but why didn't the showscreen after the usescreen -1 in the function above work?
Also how come my 2nd example code, that doesn't use a seperate function, work fine without a showscreen or even changing the usescreen value (it just uses 9)? It's like not so much that the usescreen has to be a different value but that it can't have the same value in the same code area (ie. the separate area). I mean look at the other code which works fine:-
shoptext%=GENSPRITE()
shopchar$="Accessing Shop"
CREATESCREEN 9,shoptext,targetx,shopfonth
USESCREEN 9
SETFONT shoptitlefont
PRINT shopchar$,0,0,1
USESCREEN -1
shoptext2%=GENSPRITE()
shopchar2$="Please wait..."
CREATESCREEN 9,shoptext2,targetx,shopfonth
USESCREEN 9
SETFONT shopfont
PRINT shopchar2$,0,0,1
USESCREEN -1
shoptext3%=GENSPRITE()
shopchar3$="Accessing Web"
CREATESCREEN 9,shoptext3,targetx,shopfonth
USESCREEN 9
SETFONT shoptitlefont
PRINT shopchar3$,0,0,1
USESCREEN -1
shoptext4%=GENSPRITE()
shopchar4$="Processing Info"
CREATESCREEN 9,shoptext4,targetx,shopfonth
USESCREEN 9
SETFONT shoptitlefont
PRINT shopchar4$,0,0,1
USESCREEN -1
CLEARSCREEN
STRETCHSPRITE shoptext,x*((targetx/2)-(LEN(shopchar$,1)/2)),y*((targety/2)-(shopfonth/2)-200),x*targetx,y*shopfonth
STRETCHSPRITE shoptext2,x*((targetx/2)-(LEN(shopchar2$,1)/2)),y*((targety/2)+(shopfonth/2)-200),x*targetx,y*shopfonth
STRETCHSPRITE shoptext3,x*((targetx/2)-(LEN(shopchar3$,1)/2)),y*((targety/2)+(shopfonth*2)),x*targetx,y*shopfonth
SHOWSCREEN
Note it has no showscreen until right at the end and all of them use createscreen with number 9. Works fine. Plus I have a loop a bit later that runs though an array and creates a load of sprites in the same manner all using screen number 9, and without a showscreen, and that works fine too. It's like I use the same function to do each and every sprite, rather than one function to do the lot (which works although note the drawing of the sprites is also in the same function interestingly), and it will fail.
Cheers