Conversion to octal
Lorry Litman
LLitman@exchange.hsc.mb.ca
Wed, 29 Oct 2003 11:17:51 -0600
Hi Mike,
I don't have any code but here's an example of one method to convert decimal
to octal.
Using this method the decimal number is divided by 8, then the remainder is
taken out. The remainders will be multiplied by 8 to get the correct octal
digit. This process is repeated until the quotient becomes zero.
The remainders are used to form the octal number. The first remainder
becomes the last octal digit and the last remainder becomes the first octal
digit.
convert 372 to octal 564
372/8 = 46.5 then 0.5*8 = 4
46/8 = 5.75 then 0.75*8 = 6
5/8 = 0.625 then 0.625*8 = 5
If you're not sure if your math is correct in qtp and want to check it
quickly.
At the dcl prompt
$ x=372
$ show symbol x (should yield)
X = 372 Hex = 00000174 Octal = 00000000564
If you do this in qtp I would be interested in seeing the qtp code.
Thanx
Lorry
-----Original Message-----
From: Mike Palandri [mailto:palandri@4j.lane.edu]
Sent: Wednesday, October 29, 2003 10:28 AM
To: powerh-l@lists.swau.edu
Subject: RE: Conversion to octal
It's more VMS than specifically an edu problem. I need to set up the mass
creation of VMS accounts in QTP; these accounts need to have unique UIC
numbers. It's easy enough to increment a temp in qtp, but silly ol
powerhouse counts in base 10, while the UIC numbers are in octal. I could
write the code to do it, but it would be faster if someone has already done
it, and debugged it :o(
At 08:22 AM 10/29/2003 -0800, David Morrison - Corporate wrote:
>Ha! After reading the question, I knew it would be from someone with an
>"edu" suffix!
>
>David Morrison
>McBride Electric
>
> -----Original Message-----
>From: Mike Palandri [mailto:palandri@4j.lane.edu]
>Sent: Wednesday, October 29, 2003 7:50 AM
>To: powerh-l@lists.swau.edu
>Subject: Conversion to octal
>
>Hi all,
>
>Anyone have a ready made piece of qtp code to convert a positive (base 10)
>integer to octal?
>
>Thanks,
>
>
>Mike
>.
>
>= = = = = = = = = = = = = = = = = = = = = = = = = = = =
>Mailing list: powerh-l@lists.swau.edu
>Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
>Unsubscribe: "unsubscribe <password>" in message body to
>powerh-l-request@lists.swau.edu
>http://lists.swau.edu/mailman/listinfo/powerh-l
>This list is closed, thus to post to the list you must be a subscriber.
>
>
>_________________________________________________
>Scanned on 29 Oct 2003 16:07:10
>Scanning by http://erado.com
Mike
.
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe <password>" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.