Thread: Convert Programming Language

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    2

    Convert Programming Language

    I am trying to write a program in TI BASIC (TI 83 plus calculator programming) by converting a C++ program I made, but I can't make an If-Else If statement. Does anyone know how I can write If-Else If in TI BASIC? If not, is there a site that can convert C++ to TI BASIC?

    PS I am programming in TI BASIC because I can carry my calculator with me, but not my desktop.

  2. #2
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    BASIC uses IF THEN ELSE


    Code:
    IF x = 5 THEN y = 1 ELSE IF x = 6 THEN y = 2
    You should see if it supports the PEEK and POKE commands, then write a C/C++ compiler in BASIC

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Korkymann View Post
    I am trying to write a program in TI BASIC (TI 83 plus calculator programming) by converting a C++ program I made, but I can't make an If-Else If statement. Does anyone know how I can write If-Else If in TI BASIC? If not, is there a site that can convert C++ to TI BASIC?

    PS I am programming in TI BASIC because I can carry my calculator with me, but not my desktop.
    I'm not sure if TI BASIC has an "else" syntax. That wasn't in the original BASIC anyway. The way you did "else" in traditional BASIC was:

    Code:
    if condition then goto label1
        true_block
        goto label2
    label1:
        false_block
    label2:
    It's been a while since I programmed a TI, but I think that's how you have to do it.

    EDIT: Or, for multiple chained if-else, you would do:

    Code:
    if condition1 then goto label1
    if condition2 then goto label2
    if condition3 then goto label3
    goto label4
    label1:
        block_1
        goto label4
    label2:
        block_2
        goto label4
    label3:
        block_3
        goto label4
    label4:
    Structured programming -- now do you get why it's valuable?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  4. #4
    Registered User
    Join Date
    Sep 2009
    Posts
    63
    A C++ compiler in BASIC? I think that's sacrilege, or something worse.

    In any case, I think this TI Basic tutorial site might be right up your alley.

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    2
    Thanks for your help, I have found a more relevant forum for my post (a TI BASIC programming forum to be precise).

  6. #6
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by Korkymann View Post
    Thanks for your help, I have found a more relevant forum for my post (a TI BASIC programming forum to be precise).
    Gasp!!!!, you mean there are other programming sites besides this one

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 08-21-2006, 06:42 AM
  2. What language did they make Java in?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 07-03-2005, 04:18 PM
  3. Which Language? need help ASAP
    By jcw122 in forum Tech Board
    Replies: 7
    Last Post: 03-07-2005, 04:16 PM
  4. Strange loop
    By D@rk_force in forum C++ Programming
    Replies: 22
    Last Post: 12-18-2004, 02:40 PM
  5. Convert Char to Int Function
    By drdroid in forum C++ Programming
    Replies: 9
    Last Post: 02-19-2003, 12:53 PM