The V C++ GUI Framework:V Utilities

From EDM2
Jump to: navigation, search

Several useful utility functions.

Synopsis

Header
<v/vutil.h>

Description

V provides several utility functions that can often help with software portability (and can just be useful). These are free subprograms - not a member of any specific class.

void ByteToStr(unsigned char b, char* str)
This will convert the unsigned char in b to a Hex character string in str. You need to make str big enough to hold the string.
void IntToStr(int intg, char* str)
This will convert the integer in intg to a character string in str. You need to make str big enough to hold the string.
void LongToStr(long intg, char* str)
This will convert the long integer in intg to a character string in str. You need to make str big enough to hold the string.
long StrToLong(char* str)
This will convert the character string in str into a long integer. You can cast to get ints.
void vBeep()
This utility routine will sound an audible beep.
void vGetcmdIdIndex(ItemVal cmdId, CommandObject *cmdObj)
Sometimes when you work with a CommandObject array to define a dialog, you need to access the elements of a particular item in the array. This is especially true for manipulating lists. This routine will return the index into a CommandObject array of an entry with the supplied ItemVal cmdId.
void vGetLocalTime(char* tm)
This will return a string representation of the current local time to the string tm. The format will be HH:MM:SS AM. If you need a different format, you will need to use the C functions time, localtime, and strftime directly.
void vGetLocalDate(char* dt)
This will return a string representation of the current local date to the string dt. The format will be MM/DD/YY. If you need a different format, you will need to use the C functions time, localtime, and strftime directly.