Convert number to octal

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Garren

Convert number to octal

Postby Garren » Sat Feb 19, 2005 8:32 am

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

Garren

One more thing

Postby Garren » Sat Feb 19, 2005 8:34 am

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Thu Feb 24, 2005 8:47 am

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

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

garren

Postby garren » Tue Mar 01, 2005 2:29 am

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Tue Mar 01, 2005 7:40 am

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.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Yahoo [Bot] and 7 guests