by COBS Tech Support » Wed Feb 22, 2006 9:43 pm
Yes you can use the AT() function to search a character sequence for a matching code. If a matching code is found (in this case a space character), then the AT() function will return the position of that code in the character sequence. You can use the returned number to determine how much of the product code you need to extract.
E.g.,
If At(" ", Stock->Name) = 0
PictureFileName := "c:\pics\" + Stock->Name) + ".bmp"
Else
PictureFileName := "c:\pics\" + Left(Stock->Name, At(" ", Stock->Name) - 1) + ".bmp"
Endif