January 8, 1999

Timeouts on Socket Creation

Question: I am trying to open multiple sockets at differing IP addresses. Is there a way to make it so that the open socket call will wait for only two seconds? Answer: There is no supported way of defining a timeoutfor a socket connection attempt. There is noreason this should

Positioning System.out.print

Question: How can I position the System.out.print cursor when printing to the DOS window? Specifically, how can I print to specific positions on the DOS window without printing one continuous scrolling screen? Answer: Java does not provide curses like screen control.To position the screen output cursor requires the writing of

Determing RGB values

Question: Is there an easy way of determining the RGB values when you have the long value of a color (for example, a “reverse” RGB(x,y,z) function)? Answer: You can make use of the Mod function to convert a long back into its Red, Green and Blue values. For example: li_Red

Order by

Question: I can’t sort by the second-last digit of a number (for example, sorting the numbers 4491, 1195, and 1364 by the third digit). Answer: Try using the “RIGHT” function to order the numbers. If they are stored as integers, you will first have to convert them to character. Here’s

How do I add sound to my app?

Question: I have searched high and low and cannot seem to find a code example of how to add sound (attach a WAV file) to the opening of my application. Answer: You can use the following code: Declare the following API calls:Function boolean sndPlaySoundA( & string SoundName, uint Flags )

Maximum SQL database size recommendations

Question: Are there specific recommendations for the maximum size of any database? For instance, does performance suffer if the database size is too large? Answer: Certainly, the amount of data in your database will affect performance. Remember though, that it is only one factor. Other important considerations include the number

Application Versioning

Question: Is there an easy way for Powerbuilder developers to version their apps for releases (Major.Minor.Revision)? Is this built into PB? Answer: No, you have to do this manually with your own code.

Access controls inside a tab object

Question: How can I access the controls placed on a tabpage in a tab object (for example, from a user event on a sheet window containing the tab object, to get the values of certain column of a datawindow on a tabpage of the tab object)? All tab pages are

Variant Records

Question: Does Java support an equivalent to the Pascal variant record or C union? I need to port some code to Java that uses these constructs. Answer: No, Java does not support the equivalent of variant records or unions. To achieve equivalent functionality, you can declare a class that contains

No more posts to show