Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() hey all, i had to write a program a while ago, actually in C, that is able to convert for example a dec in hex or any other number in binary, hex, oct....now i am having problems with writing the same in VBA. it would be great if somebody could post a code of a small VBA program that can convert any numbers. Heres the code of the C program, just to get you an idea of what i am talking about. Sorry for my bad english but i am from austria. thanks again, darcus #include <stdio.h void main () { /* Variable (Zeichen) definieren */ unsigned char cZeichen; printf("\nBitte geben Sie ein beliebiges Zeichen ein: "); scanf("%c", &cZeichen); /* Anlegen einer Tabelle zur Umrechnung des eingegebenen Zeichens */ printf("\n-----------------------------------------------------------------"); printf("\n|\tASCII\t|\tDez.\t|\tHex.\t|\tOkt.\t|\n "); printf("\-----------------------------------------------------------------\n"); /* Berechnung des gesuchten Wertes für eingegebenes Zeichen */ printf("\|\t%c\t|", cZeichen); /* Ausgabe des oben eingegebenen Zeichens in ASCII */ printf("\t%d\t|", cZeichen); /* Ausgabe des eingegebenen Zeichens als Dezimalzahl */ printf("\t%x\t|", cZeichen); /* Ausgabe des Zeichens als Hexadezimale */ printf("\t%o\t|\n", cZeichen); /* Ausgabe des Zeichens als Oktalzahl */ printf("\-----------------------------------------------------------------\n"); } -- darcus ------------------------------------------------------------------------ darcus's Profile: http://www.excelforum.com/member.php...o&userid=36449 View this thread: http://www.excelforum.com/showthread...hreadid=562129 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|