Freitag, 28. März 2008

BATCHLIB_ Batchlib library number.cmd

The batchlib library number.cmd is part of the batchlib package. It provides the following subroutines:

:IS_NUMBER: Checks if the first parameter is a number.
:NEAREST: Returns the nearest matching number from a sorted list of numbers.
:NEAREST_LESS: Returns the nearest matching number from a sorted list of numbers that is equal or less.
:NEAREST_GREATER: Returns the nearest matching number from a sorted list of numbers that is equal or greater.
:DEC2HEX: Converts a decimal number to hex.


Boolean :IS_NUMBER String
Checks if the first parameter is a number. That is it only contains the characters 0 to 9 and additionally the minus as the first character.
Parameters:
  1. string to test for number
Returns:
"true" if string is a valid number, "false" otherwise
Since: 1.0


Integer :NEAREST Integer[] Integer
Returns the nearest matching number from a sorted list of numbers.
Parameters:
  1. list of integers sorted ascending
  2. number to match
Returns:
nearest matching number of list
Since: 1.0


Integer :NEAREST_LESS Integer[] Integer
Returns the nearest matching number from a sorted list of numbers that is equal or less. If no such number can be found, the smallest from the list will be returned.
Parameters:
  1. list of integers sorted ascending
  2. number to match
Returns:
nearest matching number of list
Since: 1.0


Integer :NEAREST_GREATER Integer[] Integer
Returns the nearest matching number from a sorted list of numbers that is equal or greater. If no such number can be found, the greatest from the list will be returned.
Parameters:
  1. list of integers sorted ascending
  2. number to match
Returns:
nearest matching number of list
Since: 1.0


String :DEC2HEX Integer
Converts a decimal number to hex. Currently only numbers 0 <= x <= 255 are supported (0x00 <= x <= 0xFF). The result will NOT be prefixed with 0x!
Parameters:
  1. decimal number 0 <= x <= 255
Returns:
hex representation of number
Since: 1.0

Reflog

Informationstechnische Howtos, Hinweise und Merkwürdiges

Batchlib v1.0 2008-03-29

Aktuelle Beiträge

HOWTO_ O2 DSL Surf &...
Der O2 DSL Surf & Phone-Router ist für die alleinige...
cypressor - 12. Feb, 19:57
Uptweak Windows XP Home...
There are a lot of annoying limitations in Windows...
cypressor - 9. Okt, 19:30
BATCHLIB_ Batchlib package...
Download Batchlib package v1.0 (5 KB zip file) What...
cypressor - 29. Mär, 19:10
BATCHLIB_ Batchlib library...
The batchlib library string.cmd is part of the batchlib...
cypressor - 29. Mär, 18:10

Homepage Ticker

Links

Status

Online seit 6577 Tagen
Zuletzt aktualisiert: 28. Jun, 11:32
RSS XML 1.0 Button-Get-Firefox

batch
batchlib
howto
tech
video
Profil
Abmelden
Weblog abonnieren