Re: emulator speed
Farzin Ashraghi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think that I am developing my patience :) I don't know why, but I perceive that the Palm emulator responses to external instructions is very slow and sometimes it doesn't react but after retrying several times pressing a button. Do you think that it is related with the computer processor speed? I try to use in two similar computers (Pentium 166MHz, 32Mb RAM) but in both cases I have the same delay. You might be having the problem that's remedied in the following news article from the emulator forum: news:[EMAIL PROTECTED] Good luck, Noah Young (Metta4) -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
Can you trash a Palm programmatically?
Recently I've been working on a program that talks to a proprietary device through its the Palm's serial port. The program seems to work pretty well, but the Palm is having troubles. Because I'm a fairly new Palm programmer, I suspect that I may have failed to clean up my garbage somehow. Problem is, I have done several hard resets and, despite the fact that I haven't reloaded the program on the device, I'm still having problems with it. It will sometimes not turn on when I hit the button and refuse to turn on until I do a soft reset. Other times the screen will come on but it will be partially filled up with horizontal lines which sometimes move around like an old TV that someone's been playing with the knobs of. Oddly enough, it still seems to keep time and the datebook alarms still go off, even when the screen refuses to come up and show me what datebook event has occured. I understand that programming can sometimes mess up the OS, requiring the occasional hard reset. But I was unaware of the possibility of actually frying the hardware... Is there something I can do beyond a hard reset? Is this an impossible situation? Should I suspect some sort of harmful interaction between the Palm and my proprietary device? Odd voltage levels perhaps? (I believe the device is depending upon the Palm for a small amount of power through the serial line.) Any help would be greatly appreciated! Thanks in advance. Noah Young (Metta4) -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
Re: Emulation of serial port
revcom [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Does anyone know if the emulated Palm correctly performs RTS/CTS handshaking on the emulated PC or Mac? Just recently I wrote a program that uses the serial port to talk to a proprietary device that depends upon RTS/CTS handshaking. I used the emulator on my PC, directed toward a COM port, to debug the program and it worked just fine. At one point, while eliminating a bug possibility, I tried turning the handshaking off. Sure enough, all communication stopped. Must work... (It also worked fine when I actually sent it to the device.) NOTE: To get it to work you may need to make calls to the API as follows in your AppStart or similar program location: Err err; SerSettingsType sst; err = SerGetSettings( gSerialRefNum, sst ); if(err !=0) { ErrNonFatalDisplayIf(err !=0, Error getting serial settings); SerClose( gSerialRefNum ); return err; } // Turn on CTS handshaking sst.flags |= serSettingsFlagCTSAutoM; err = SerSetSettings( gSerialRefNum, sst ); if(err !=0) { ErrNonFatalDisplayIf(err !=0, Error enabling CTS handshake); SerClose( gSerialRefNum ); return err; } Hope this helps, Noah Young (Metta4) -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
Re: Floating point support
In email, Andre S. Chen wrote: I am making use of the FloatToString function you posted on Palm Dev Forum on July 14. I think there may be a bug, however. It seems to turn a float between 0 and -1 into a positive number string. I'm not much of a programmer so I wanted to see if you were getting the same results. I looked into it and here's a fix. (Yeah, I've got a feeling there's a more elegant way to do all of this. But I don't really have the time right now for more than a simple patch. Seems to work.) void FloatToString (double value, char * buffer, int round) { long iValue; double dDecimal; long iDecValue; int i; char sResult[50]; char sDecimal[50]; char *sTemp = sResult; iValue = value; if( value 0 ) { dDecimal = -(value - iValue); // Make sure that negative #s where -1 n 0 // get handled correctly. if( 0 == iValue ) StrCopy( sTemp++, - ); } else dDecimal = value - iValue; if (dDecimal 0.1) dDecimal = 0; // Convert integer portion to string StrIToA( sTemp, iValue); if (StrLen(sTemp) 1) StrCopy(sTemp, 0); StrCat(sResult, .); // Round decimal portion for (i = 1; i = round; i++) dDecimal = dDecimal * 10; iDecValue = dDecimal; if (dDecimal - iDecValue = 0.5) iDecValue++; // Add decimal portion StrIToA (sDecimal, iDecValue); // Add leading zeros if neccessary if (StrLen (sDecimal) round) for (i = 1; i = round - StrLen(sDecimal); i++) StrCat (sResult, 0); StrCat (sResult, sDecimal); // Copy into return string StrCopy (buffer, sResult); } -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
Re: Floating point support
Sergio Carvalho wrote: Are there any functions that convert Float variables to/from strings? StrPrintf doesn't seem to support the %f format specification... Roberto Amorim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Sergio, I had this problem last week and Thiago Rossato sent me this function. I hope this help you too. Thanks a bunch for posting that function. It was very helpful. However, it has a bug that causes it to not process negative numbers as one might expect. The code below fixes that problem by changing the decimal part of the number to a positive number for processing. Seems to work great now. Thanks again, Noah Young (Metta4) void FloatToString (float value, char * buffer, int round) { long iValue; float dDecimal; long iDecValue; int i; char sResult[50]; char sDecimal[50]; iValue = value; dDecimal = value - iValue; // Make sure rounding will still work if value is negative if( value 0 ) dDecimal = -dDecimal; if (dDecimal 0.1) dDecimal = 0; // Convert integer portion to string StrIToA(sResult, iValue); if (StrLen(sResult) 1) StrCopy(sResult, 0); StrCat(sResult, .); // Round decimal portion for (i = 1; i = round; i++) dDecimal = dDecimal * 10; iDecValue = dDecimal; if (dDecimal - iDecValue = 0.5) iDecValue++; // Add decimal portion StrIToA (sDecimal, iDecValue); // Add leading zeros if neccessary if (StrLen (sDecimal) round) for (i = 1; i = round - StrLen(sDecimal); i++) StrCat (sResult, 0); StrCat (sResult, sDecimal); // Copy into return string StrCopy (buffer, sResult); } -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
Re: emulator speed
"Farzin Ashraghi" [EMAIL PROTECTED] wrote in message news:18960@palm-dev-forum... I think that I am developing my patience :) I don't know why, but I perceive that the Palm emulator responses to external instructions is very slow and sometimes it doesn't react but after retrying several times pressing a button. Do you think that it is related with the computer processor speed? I try to use in two similar computers (Pentium 166MHz, 32Mb RAM) but in both cases I have the same delay. You might be having the problem that's remedied in the following news article from the emulator forum: news:18579@emulator-forum Good luck, Noah Young (Metta4) -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: Floating point support
In email, Andre S. Chen wrote: I am making use of the FloatToString function you posted on Palm Dev Forum on July 14. I think there may be a bug, however. It seems to turn a float between 0 and -1 into a positive number string. I'm not much of a programmer so I wanted to see if you were getting the same results. I looked into it and here's a fix. (Yeah, I've got a feeling there's a more elegant way to do all of this. But I don't really have the time right now for more than a simple patch. Seems to work.) void FloatToString (double value, char * buffer, int round) { long iValue; double dDecimal; long iDecValue; int i; char sResult[50]; char sDecimal[50]; char *sTemp = sResult; iValue = value; if( value 0 ) { dDecimal = -(value - iValue); // Make sure that negative #s where -1 n 0 // get handled correctly. if( 0 == iValue ) StrCopy( sTemp++, "-" ); } else dDecimal = value - iValue; if (dDecimal 0.1) dDecimal = 0; // Convert integer portion to string StrIToA( sTemp, iValue); if (StrLen(sTemp) 1) StrCopy(sTemp, "0"); StrCat(sResult, "."); // Round decimal portion for (i = 1; i = round; i++) dDecimal = dDecimal * 10; iDecValue = dDecimal; if (dDecimal - iDecValue = 0.5) iDecValue++; // Add decimal portion StrIToA (sDecimal, iDecValue); // Add leading zeros if neccessary if (StrLen (sDecimal) round) for (i = 1; i = round - StrLen(sDecimal); i++) StrCat (sResult, "0"); StrCat (sResult, sDecimal); // Copy into return string StrCopy (buffer, sResult); } -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: Emulation of serial port
"revcom" [EMAIL PROTECTED] wrote in message news:18555@palm-dev-forum... Does anyone know if the emulated Palm correctly performs RTS/CTS handshaking on the emulated PC or Mac? Just recently I wrote a program that uses the serial port to talk to a proprietary device that depends upon RTS/CTS handshaking. I used the emulator on my PC, directed toward a COM port, to debug the program and it worked just fine. At one point, while eliminating a bug possibility, I tried turning the handshaking off. Sure enough, all communication stopped. Must work... (It also worked fine when I actually sent it to the device.) NOTE: To get it to work you may need to make calls to the API as follows in your AppStart or similar program location: Err err; SerSettingsType sst; err = SerGetSettings( gSerialRefNum, sst ); if(err !=0) { ErrNonFatalDisplayIf(err !=0, "Error getting serial settings"); SerClose( gSerialRefNum ); return err; } // Turn on CTS handshaking sst.flags |= serSettingsFlagCTSAutoM; err = SerSetSettings( gSerialRefNum, sst ); if(err !=0) { ErrNonFatalDisplayIf(err !=0, "Error enabling CTS handshake"); SerClose( gSerialRefNum ); return err; } Hope this helps, Noah Young (Metta4) -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Can you trash a Palm programmatically?
Recently I've been working on a program that talks to a proprietary device through its the Palm's serial port. The program seems to work pretty well, but the Palm is having troubles. Because I'm a fairly new Palm programmer, I suspect that I may have failed to clean up my garbage somehow. Problem is, I have done several hard resets and, despite the fact that I haven't reloaded the program on the device, I'm still having problems with it. It will sometimes not turn on when I hit the button and refuse to turn on until I do a soft reset. Other times the screen will come on but it will be partially filled up with horizontal lines which sometimes move around like an old TV that someone's been playing with the knobs of. Oddly enough, it still seems to keep time and the datebook alarms still go off, even when the screen refuses to come up and show me what datebook event has occured. I understand that programming can sometimes mess up the OS, requiring the occasional hard reset. But I was unaware of the possibility of actually frying the hardware... Is there something I can do beyond a hard reset? Is this an impossible situation? Should I suspect some sort of harmful interaction between the Palm and my proprietary device? Odd voltage levels perhaps? (I believe the device is depending upon the Palm for a small amount of power through the serial line.) Any help would be greatly appreciated! Thanks in advance. Noah Young (Metta4) -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/