Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to play a waveform sound (a WAV file in particular)
Obtaining MAC address through Address Resolution Protocol (ARP) request
Using the GetTempFileName
Winsock: how to retrieve the protocol information corresponding to a protocol name
Accessing the list of Windows Recent Documents
Creating two-byte hashes for a list of URLs
Current System information
GetFileOwner - Get the owner of an NTFS file
Retrieving System Error message strings
Retrieving the priority class for the current process
Using Multimedia Command Strings to play MIDI files
Creating a unique filename based on existing filename
High-powered ALLTRIM
Converting twips to pixels and vice versa
Dial the Net Automatically
DiskFreeSpace class
Enhanced GetFont dialog
Enumerating files opened on the network
How to hide your program from the Close Program dialog (Win9* only)
Pocket PC: creating new database in the Object Store and copying Contacts Database records into it
Saving available locale records into a cursor
Simulating DOEVENTS
Testing Transparent Menu Class with top-level form (requires VFP9)
Extracting the name and extension parts of a path string
High-powered ALLTRIM

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
DECLARE SHORT StrTrim IN Shlwapi As StrTrim;
       STRING @ pszSource,;
       STRING   pszTrimChars
 
lcSrc = "____//Turtle Soup/  "
 
* notice: three characters included in the list
* of characters to be trimmed
lcTrimChars = "_ /"
 
? "Before: ", "["+ lcSrc +"]"
= StrTrim (@lcSrc, lcTrimChars)
? "After:  ", "[" + LEFT(lcSrc, AT(Chr(0),lcSrc)-1) + "]"
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
362 bytes  
Created: 2001-08-15 12:00:00  
Modified: 2001-09-28 16:45:31  
Visits in 7 days: 56  
Listed functions:
StrTrim
Printer friendly API declarations
My comment:
Unlike the native ALLTRIM, this function can remove not only blanks but any other characters included in the trim character list.

For example, to trim a text, surrounded with any combination of blanks, tabs and quotations, include in this list those three characters:
        - space
        - tab (Chr(9))
        - "
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (107.22.156.205)
2.83 hrs.Function: 'ScreenToClient'
Function group: 'Coordinate Space and Transformation'
4.67 hrs.Example: 'Reading list of folders and files on FTP server'
 Function: 'QueryDosDevice'
6.97 hrs.Function: 'SelectObject'
Function group: 'Device Context'
 Example: 'Reading the structure of VFP main menu'
Google
Advertise here!