The V C++ GUI Framework:V Utilities: Difference between revisions
Created page with " Several useful utility functions. ==Synopsis== ; '''Header:''' : <tt>[vquickr.htm#VUTIL <v/vutil.h>]</tt> ==Description== '''''V''''' provides several utility functions that..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
Several useful utility functions. | Several useful utility functions. | ||
==Synopsis== | ==Synopsis== | ||
; '''Header:''' | ; '''Header:''' | ||
: <tt>[vquickr.htm#VUTIL <v/vutil.h>]</tt> | : <tt>[vquickr.htm#VUTIL <v/vutil.h>]</tt> | ||
Line 43: | Line 41: | ||
This will return a string representation of the current local date to the string <tt>dt</tt><nowiki>. The format will be ``MM/DD/YY''. If you need a different format, you will need to use the C functions </nowiki><tt>time</tt>, <tt>localtime</tt>, and <tt>strftime</tt> directly. | This will return a string representation of the current local date to the string <tt>dt</tt><nowiki>. The format will be ``MM/DD/YY''. If you need a different format, you will need to use the C functions </nowiki><tt>time</tt>, <tt>localtime</tt>, and <tt>strftime</tt> directly. | ||
[[Category: | [[Category:V C++ GUI Framework]] |
Revision as of 17:46, 1 March 2017
Several useful utility functions.
Synopsis
- Header:
- [vquickr.htm#VUTIL <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.