Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quiz on Programming
Message
De
01/04/1998 19:33:22
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00088587
Message ID:
00088843
Vues:
39
>>>>>If you can't use Int(), Round(), Floor(), Ceiling() or
>>>>>any similar function to cut off integer.
>>>>>
>>>>>cAn you write a function equiv. to Round()?
>>>>>Of cos, You can use / and % (mod) ^_^;
>>>>
>>>>Off the top of my head
>>>>
>>>>lcdeci = SET ('Decimals')
>>>>x='3423432.3523'
>>>>SET DECIMAL TO 0 && if not, you get trailing 0's on ?y to screen
>>>>y=VAL(STR(x))
>>>>SET DECIMALS TO lcdeci && Set Deci back to default
>>>>
>>>>*****
>>>>This is how I would do it if I couldn't use the built in functions.
>>>
>>>
>>>#___#' Actually, I should say: Suppose You are the low level developer.
>>>
>>>You need to use coding of +, -, *, /, % to make the Round(), Int(),....
>>>to other on use and therefore, There should be no simply method to do...
>>>Actually, Str(nNumber, NLength [, nDecimal]) are calling Round() in its
>>>internal... So, not really answer it!
>>>
>>>Coding will like:
>>>if nNumber - 0.5 > ?? && then
>>> nNumber = nNumber + 1
>>>....
>>>endif
>>
>>
>>If I were a low level programmer than I would not be reading or posting to this group. Please don't attempt to impress me with your knowledge of NON-Foxpro programming languages. I don't care.
>
>I'm behind you here Fred, Justok - why are you trying to reinvent the functionality of FoxPro - why are you asking FoxPro Developers how to write low level equivalents of FoxPro functions??? Its a waste of time and people will just start ignoring your threads - what then if you need our help???

Hey, Hey now. It's all in fun, that's why its in the chatter section. This section was meant for non-technical jabber or non-Fox stuff. Justok was just putting forth a logical problem like many here have done before and many others have responded to merrily. Justok's not trying to show off any more than you would be showing off by asking somebody a riddle.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform