Convert number to octal

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Garren

Convert number to octal

Post by Garren »

What is the easiest way to convert a number to octal in TextPipe Pro?
Thanks,
Garren
Garren

One more thing

Post by Garren »

One more thing...

I tried using the VBScript but this won't let me do large numbers. I can only do like 8 digits and I need to do 11 digit numbers.
Garren
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

Can you post the code you've used to achieve 8 digits?
garren

Post by garren »

I used the VBscript function and had this in process line:

function processLine(line, EOL)
processLine = oct(line)
end function

oct is just a VB function, and in doing research it looks like it is limitation of the function that it can only handle 11 characters.

I tried to do this with the following perl script:

sub processLine {
$o = ($_[1]);
$n = oct($_[0]) if $_[0] =~ /^0/;
}

but when I try to run it I get the following error:

Missing function - processLine
Note - script language may be case sensitive.

I am not sure why I get this error because I have the above function.

Any help with the perlscript error or another way to do it would be appreciative.
Thanks,
Garren
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

Hi Garren,

perlscript doesn't work - we have an active bug request with ActiveState.

You're going to have to write a function that shifts the bits of the number progressively and builds the octal number.
Post Reply