Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Pascal/Delphi

Pascal/Delphi Forum for discussing Borland Delphi and Pascal coding techniques, tips and tricks.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-27-2007, 03:32 AM
Krad Krad is offline
Newbie
 
Join Date: Nov 2007
Posts: 2
Rep Power: 0
Krad is on a distinguished road
Default [Pascal in Delphi]System to system

Hi! I can't do a simple program in Pascal... I need to program which change any system for example dec, hex... to other system for example binary code, but (in program) i must give this system:

begginig
"Please give a system:" for example 2
"Please give second system:" for. ex. 16
"Give me a value:" 01001

"Value is..."

And now it change me from binary to 16 system a value 01001.
How it write?
Sorrry for my English but it isn't good in computers. Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 11-27-2007, 12:10 PM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,392
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default

First question: can you do this with a pencil and paper?
When I did this program, my strategy was go from base A to decimal to base B.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-27-2007, 01:46 PM
Krad Krad is offline
Newbie
 
Join Date: Nov 2007
Posts: 2
Rep Power: 0
Krad is on a distinguished road
Default

Uhm... no. I do it in Delphi.
Code for change a other system to binary:

Code:
program NaDowolnySystem;

{$APPTYPE CONSOLE}

const
SYSTEM='0123456789ABCDEFGHIJKLMNOPRSTUWXYZ';
var
wynik:string;
NaSystem,JakaLiczba:integer;
begin
  repeat
    write('What system (max 34): ');
    readln(NaSystem);
  until NaSystem in [2..34];
  write('Give value: ');
  readln(JakaLiczba);
  repeat
    wynik:=SYSTEM[JakaLiczba mod NaSystem+1] + wynik;
    JakaLiczba:=JakaLiczba div NaSystem;
  until JakaLiczba=0;
  writeln('Wynik: ',wynik);
  readln;
end.
But I need program in two side - from other system to other (not binary) AND change loop 'repeat' on FOR.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-28-2007, 11:26 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Moderator
 
Join Date: Jul 2006
Age: 35
Posts: 3,392
Last Blog:
wxWidgets is NOT code ...
Rep Power: 37
WingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to beholdWingedPanther is a splendid one to behold
Default

Krad, my point was that if you can't do the conversions by hand, then you will NEVER be able to program the conversions. Do you know how to do the conversions by hand?
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Programming is a branch of mathematics.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-16-2007, 12:24 PM
t3chn0n3rd t3chn0n3rd is offline
Newbie
 
Join Date: Dec 2007
Posts: 2
Rep Power: 0
t3chn0n3rd is on a distinguished road
Default Pascal compiler

Are you using a borland compiler?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 12-27-2007, 02:35 PM
olegator olegator is offline
Newbie
 
Join Date: Dec 2007
Posts: 1
Rep Power: 0
olegator is on a distinguished road
Default

If you using a borland compiler, you can use function: IntToBin, IntToHex, BinToHex etc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows XP Tricks & Tips!!!!..new ones. pranky Tutorials 9 08-23-2008 04:22 PM
Operating System prnoct90 General Programming 6 11-01-2007 11:56 PM
Free Account creator and Billing system xtraze The Lounge 1 01-16-2007 03:17 PM
Project: vBulletin Alert System (vbAS) Crane Community Projects 18 12-13-2006 11:54 AM
Store and Points System Jordan Announcements 9 08-28-2006 02:38 PM


All times are GMT -5. The time now is 02:52 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads