ken bohnenkamp
26th September 2002, 17:48
I have a 10 character field that a user will be entering into. The first 4 positions are entered as character the next 6 positions are entered as digits. I want to convert the first 4 positions to upper case if the user happens to enter lower case. Can someone send me the syntax to do this type of logic.

Also does anyone know where in the help system I can find help on how to use patterns and pattern matching.

mark_h
26th September 2002, 18:02
You could try:

somestr = toupper$(somestr(1;4)) & somestr(5;6)

Good Luck!

Mark

zacharyg
27th September 2002, 00:09
I suppose you want to search for a pattern in a string ....

pos() and rpos() could be of help. Here and extracted description

These return the start position of a specified substring (pattern) in a specified string (source). source and pattern can be either strings or string expressions.
pos() starts searching for the substring at the first position in the source string. rpos() starts searching at the last position in the source string. Both return the start position relative to the beginning of the source string.


Refer to the Board Library for a detailed description.