Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Truncating a string.............
Message
De
28/06/2000 13:26:21
Liam O'Hagan
O'Hagan Programming Ltd
Irlande
 
 
À
28/06/2000 13:09:22
Jimmy Ditta
Twin City Electronics
Monroe, Louisiane, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00385891
Message ID:
00385904
Vues:
11
Hi Jimmy,

If the stock number is a fixed length string then use SUBSTR(stocknumber, startposn, numchars)

If it is not fixed length then you need to establish the length of the number (assuming that there is a hyphen in the stock number as per your example)

lnStartPos = 3 && the number begins after "BR"
lcNum = Substr(StockNumber, lnStartPos, AT("-", StockNumber)-lnStartPos)

You will need to convert to a numeric type using VAL before you can use it for calculations.

HTH

Liam

>I have a stocknumber for each product similar to BR(number)-stuff. I need to extract (number) from the stocknumber shown in a drop down for use in a mathematical expression with a value in another. What expression should I use to do the extraction?
>
>Thanks,
>JD
Liam O'Hagan
MCP VFP Desktop Apps
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform