March 29, 2024, 12:53:03 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Len and Mid$ for numbers

Started by Andy, May 22, 2016, 05:13:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

May 22, 2016, 05:13:00 AM Last Edit: May 22, 2016, 05:23:40 AM by Andy
Here I've created the equivalent of LEN and MID$ for numbers, which I think you'll find very very useful, and I wish I'd had these functions to hand a long time ago.

SMLenN - gets the length of a number.
SMMidN - gets the Nth number of the number.
SMDP - gets the decimal point position of the number.

As always, copy the .lib to your libs folder, and the .inc to your includes folder.

Let me know if this is useful please...

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Andy


I've added in some more number functions for you, and extended the SMMidN function to work like MID$,
that is, a start position, and the length required.

SMMidN           - (number, start position, for X length of the number)
SMValBeforeDP - gets the value of a number before the decimal point
SMValAfterDP   - gets the value of a number after the decimal point

I've included the new help file for this latest StringMap version (10.02).

Attached is the zip file.

As always, copy the .lib to your libs folder, and the .inc to your includes folder.

You can then compile Numbers.iwb

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

Thanks for sharing Andy!

Quoteand I wish I'd had these functions to hand a long time ago

So do I, but if I ever get around to make the remote control software for my Yaesu FT-717ND portable low-power radio transceiver I've been thinking of so long, these routines appears to be tailormade for that purpose.


Regards,
Egil.
Support Amateur Radio  -  Have a ham  for dinner!