Read-only archive of the All About Symbian forum (2001–2013) · About this archive

couple newbie opl question

11 replies · 2,542 views · Started 11 March 2003

ok ive got a few codes ive done and ready to use in eventcore opl. but the thing is i cant get a new screen like as in clear white screen. the mbm (frepoc logo) i cant get rid of. i tried the CLS comman to get a white page but no luck.
Another thing is use gat style and gprint but when i use input it just over writes all the print and i cant set where the input cursor goes. can anyone help me out or point me to some OPL (eventcore) source codes... i tried going through the tute but didnt get anything outta it...
thanx guys any help would be great.

I never used input command ...
You're in a UI invironment use textboxes in dialogs ...
I'm a bit rusty at the moment but I think there is a gcls (cls is for text only where gat and the logo are graphic based)

Following the logic of text vs graphic you might try a ginput command 😃

I'll check when I get home, if you can't figure it out 😉

ive tried ginput does nothing...
thanx for the help daz... if u have source codes can u post some up if thats possible that would b a great help... i havent got any source codes that uses textboxes for input so i wouldnt know what the syntax are. thanx again daz

Mad,

Are ou just tring to take in a text input line, or a whole paragraph? If you want to givre us some context, source code snippet shouldn;t be a problem.

k heres wat im tryin to do. i just want to make the font abit larger then the original PRINT text, so i used gprint wit style which is a tad larger which is enuff. dont laugh at the code im not a programmer just need this to simplify my work so i just gave it a go. it works partly :P
once i solve the prob wit scrolling and small text ill use the event core which is more looks more presentable. my text menus r messy :P
k thanx guys. Oh yeah if any1 is interested its a sheetmetal calc. which boiler makers can use aswell.

PROC bend:
LOCAL cir, A, CR, D, SEG, seg1, can1, can2, segTotal, sumTotal,
r, IntC, intDV, T, DR, divSpace, lineNum, gatnum, DR1, r1, DR2, DR3
CLS
Print "Bend"
PRINT "Circ.=", :INPUT CIR :PRINT "Angle=", :INPUT A :PRINT "C.R",
:INPUT CR :PRINT "Divisions=", :INPUT D :PRINT "Segments =", :INPUT SEG : cls
Seg = A/SEG/2
can1 = Seg1*pi/180
sumTotal = tan (can1)
r = CIR / PI / 2
intC = 0
DO
intC = intC + 12
T = 360 / D
DivSpace = CIR / D
gat 0,15 : gPRINT "Div Space",D, "=", DivSpace
UNTIL intC = D
intDV = -T
lineNum = 0
gatnum = 30
DO
intDV = intDV + T
lineNum = lineNum + 1
gatnum = gatnum + 15
r1 = intDV*(pi/180)
DR1 = COS(r1) * r
DR2 = CR - DR1
DR3 = DR2
DR = DR3 * sumTotal
pause get rem i want it to pause here till i press a certain key but i couldnt do that so just any key
gat 0, gatnum :gPRINT "Line num", lineNum, ":", DR rem lame attempt at using gprint and gat. one thing is if my prog prints past the screen i cant scroll... if i dont use gprint and just use print it will scroll for every print..
UNTIL intDV = 180
end_of_prog: rem part of a menu i didnt add this in
ENDP

sorry if code is bit hard to read...

forgot to answer ur q ewan ... im taking in a line of text(numbers) and when i use the input it displays small text and overwrites my gprints.

[code:1]PROC g_prefs:
dINIT "Preferences"
dLONG step&,"Step amount in pixels:",10,170

dCHOICE endaction%,"On end of archive:","Return to start,Ask for next archive"
dBUTTONS "Close",KdBUTTONEnter%
LOCK ON : DIALOG : LOCK OFF
ENDP[/code:1]Notice: [code:1]dLONG step&,"Step amount in pixels:",10,170
[/code:1]

But that's only a dialog box ...

Oh wait that ain't a textbox anymore 😃

Anyway, the answer should be in here:
http://www.emccsoft.com/devzone/ppc/ppc.pdf

[code:1]
PROC fake_input:
LOCAL foo%,input$
foo%=0
input$=""
dINIT "Input Statement (in a Dialog Box)"
dTEXT "Question",input$
rem // Leave Question as "" for no prompt
DO
foo%=DIALOG
UNTIL foo%=13 : rem // ie if DIALOG returns 13, which is ENTER being pressed
RETURN input$
ENDP
[/code:1]

Call this with..

[code:1]
test$=fake_input:
[/code:1]

It;'s probably best to get into the habit of using dialogs and gPRINTS, gATs and gSTYLEs as soon as possible, and not rely on direct PRINT ing and CLS ing of the initial window.

[quote="Ewan-FreEPOC"][code:1]
PROC fake_input:
LOCAL foo%,input$
foo%=0
input$=""
dINIT "Input Statement (in a Dialog Box)"
dTEXT "Question",input$
rem // Leave Question as "" for no prompt
DO
foo%=DIALOG
UNTIL foo%=13 : rem // ie if DIALOG returns 13, which is ENTER being pressed
RETURN input$
ENDP
[/code:1]

Call this with..

[code:1]
test$=fake_input:
[/code:1]

It;'s probably best to get into the habit of using dialogs and gPRINTS, gATs and gSTYLEs as soon as possible, and not rely on direct PRINT ing and CLS ing of the initial window.[/quote]

ive typed out that code and tried to run it i get a declaration error.
wat am i doing wrong?

[code:1]LOCAL input$ [/code:1]
should be [code:1]LOCAL input$(255)[/code:1]

or something allike 😉