aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1618

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1618  How to stop time out of the handheld?

17/07/2008 @ 11:29
by Gary

Anonymous



How do you stop the handheld from stopping a program after 3 minutes.

I wrote a timer program that counts down to zero, but if I set it to count down to zero from ten minutes the palm shuts down after 3 Min's and stops the programs execution before it can end properly.

Is there a way to let the screen black out, but leave the program running until if finishes?

Thanks
Gary
  Post an answer  Top

[]   

StartPrevious [ 1 2 ] NextEnd

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
18/07/2008 @ 22:51
by aldweb

Anonymous

visitor
Hello Gary,

To modify the device's default auto-off delay to more than 3 minutes, you will have to call a Palm OS API function, which is something that can easily be coded using a PP applet. The API function to use is SysSetAutoOffTime() which is described as follows:


Purpose: Set the time out value in seconds for auto-power-off. Zero means
never power off.
Prototype: UInt16 SysSetAutoOffTime (UInt16 seconds)
Parameters: seconds Time out in seconds, or 0 for no time out.
Result: Returns previous value of time out in seconds.

Cheers,
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3
--------
20/07/2008 @ 14:52
by JoeV

Anonymous

visitor
Hello Gary,

Aldweb has written some good tutorials on PP at www.ppcompiler.org. This is how I got started.

I also ran into the same problem, the palm timing out. So I wrote some pp code to change the timeout time. From Izibasic, insert the statement:

r$=CALLPP(160,"0")

to disable the shutdown time.

Here is the pp code:

{ 8-Apr-2007

This applet will allow the caller to change the auto off time of the palm.

Call the applet from izibasic using the format: R$=CALLPP(160,S$) where S$
is the new off time in seconds. R$ returns the previous auto off time in
seconds.

}


{$code appl,JVxx,code,160} //required by iziBasic
program ppcall160;

{$i PalmAPI.pas}
type
iBasFunType=function(S:string):string; //required by iziBasic
var
iBasCallPP:iBasFunType; //required by iziBasic

function SysSetAutoOffTime(sec:UInt16):Uint16;inline(SYSTRAP,$A0c0);

function CallPP(S:string):string;
var
s1:string;
timeo,lto:Uint16;

begin
timeo:=stratoi(s);
lto:=SysSetAutoOffTime(timeo); //set new auto off time
stritoa(s1,lto);
callpp:=s1; //return with old off time

end;

//Main. Required by iziBasic
begin
iBasCallPP:=CallPP;

end.

Hope this helps. Good luck.

JoeV
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 4
--------
20/07/2008 @ 16:36
by Gary

Anonymous

visitor
Thanks Joe, I'll have a look at the tutorials and your code.

I found some free ware programs that do what I want, but it would be better to have something written in the code. The problem with a free ware program is that it disables auto shut off for all programs. I only need it to disable my timer program.

I never programed in pp, but I never programed in iziBasic either and I've gotten the hang of it

Thanks again
Gary
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 5
--------
20/07/2008 @ 19:55
by JoeV

Anonymous

visitor
Hello again Gary,

I recommend learning both PP and the palm API calls. Then you can do anything the palm is capable of doing. I learned it and I am not a programmer.

Once you disect my applet code you will find that it is extremely simple. My code returns the current timeout so that you can restore it before you exit your program.

Take care and good luck.

JoeV
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 6
--------
04/08/2008 @ 03:55
by Gary

Anonymous

visitor
I tried your code and I am having a problem getting it to work.

I Built the pp code that you posted and it was created.

Here is some code from my program.

BEGIN
R$=CALLPP$(160,"0")
MENU 800
R=COLOR(0)
GOSUB _OnAppStart
GOSUB _GenerateGUI
GOSUB _EventsLoop
GOSUB _OnAppExit
END

_OnAppExit:
R$=CALLPP$(160,R$)
RETURN

I have the handheld set to auto-off at 30 seconds

After running the program it shuts down at 30 seconds.

Am I calling it wrong or is it not seeing the pp code?

When I get it working will the pp code be part of the stand-alone PRC?

Thanks
Gary
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 7
--------
04/08/2008 @ 06:04
by Gary

Anonymous

visitor
I forgot to mention that I changed the program from this:

{$code appl,JVxx,code,160} //required by iziBasic
program ppcall160;

To this:

{$code appl,tImr,code,160} //required by iziBasic
program Timer;

tImr is the creator ID from my timer program and Timer is the name of the program.

The izibasic file is called Timer.ibas, but when I tried to build the pp code it said the PRC was not created. when I used Timer which is the name of the PRC it then created the PRC.

Thanks
Gary
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 8
--------
05/08/2008 @ 18:50
by JoeV

Anonymous

visitor
Hello Gary,

After your first callpp$, R$ should return the current timeout in seconds. In your case, that would be 30. Print R$ and see.

Yes, the pp code will be part of your final compiled app. To check for this, look at your compiled Izibasic program with a resource editor like Bird. Your program should contain the resource "code 160", indicating that the applet is compiled and included in your app.

Hope this helps.

JoeV
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 9
--------
06/08/2008 @ 08:53
by Gary

Anonymous

visitor
Joe, thanks for getting back, but I am still having some trouble finding the problem.

Your code will compile as written, but when I instert my program name it does not compile.

{$code appl,tImr,code,160} //required by iziBasic
program ppcall160;

It compiles when written like this, but when I change the program name to my program name it does not compile.

When I change ppcall160 to Timer.ibas it will not compile.

I have tried to print it, but there is nothing to print because it's empty.

It compiles with my creator ID, but not my program name. Could there be something with my program name that is not allowed in pp?
  Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 10
--------
06/08/2008 @ 12:04
by aldweb

Anonymous

visitor
Hello Gary and JoeV,

Gary, make sure that you compile first your iziBasic source code, then the PP applet. The PP applet will be added to the PRC generated by iziBasic.
If you proceed the other way, iziBasic's compilation will delete the PP applet code resource.

You may also compile the PP applet separately, then add the generated code resource to your iziBasic resource file (using Bird). Then, compiling the iziBasic project will be enough. This is the easy way of proceeding once your PP applet is finalized.

Cheers,
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 11
--------
07/08/2008 @ 01:35
by Gary

Anonymous

visitor
Thanks Aldweb, you will not believe this, but last night while I tried to sleep and having no luck because of my code problems I had the same ideal. However, I forgot about it and did not try anything until I opened up this thread. Then I tried it and it worked

Could recomend a good place to learn pp code and applet's? I have been looking over the pp code and it's not much harder than izibasic, but I don't know anything about API calls and how to convert from C to pp. I have ordered a couple of books on Pascal, a beginners guide and Turbo Pascal. I've been looking through the beginners guide, but I did not get the Turbo Pascal yet.

What is the difference betweem Build and Make when I compile a pp applet?
  Post an answer  Top
StartPrevious [ 1 2 ] NextEnd
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^