Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Kiligolo on October 22, 2010, 02:44:54 pm

Title: Chaine et variables (string and variable) [English/French]
Post by: Kiligolo on October 22, 2010, 02:44:54 pm
Bonjour,

Je suis en train de programmer et je ne sais pas comment "transformer" (ou mettre) une variable dans une chaine. ???
Quelqu'un pourrais me dire comment on fait, merci d'avance!  :)

Hello,

I am programming and I do not know how to save a variable in a string. ???
Somebody could me say how to do, thanks! :)
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Munchor on October 22, 2010, 02:50:51 pm
transformer une variable dans une chaine?

Une variable qu'est'un numero pour un chaine?
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Kiligolo on October 22, 2010, 03:13:21 pm
J'aimerais enregistrer une variable (A par exemple) dans une chaine (Str1 par exemple). Mais je ne connais que la fonction expr( qui fait l'inverse :( . Je ne sais pas si c'est possible mais je me rappelle avoir fait ceci...

I would like to save a variable (A for example) in a string (Str1 for example). But I know only the function expr( which does unlike :( . I do not know if it is possible but I remember doing this...
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Munchor on October 22, 2010, 03:19:27 pm
Si tu veux declarer une chaine fais comme ça:

Code: [Select]
"Salut, monde!" (STO->) str1

----------------------------OU----------------------

Input "", str2
Disp str2

Mais je ne comprehends pas ce que tu dis trés bien :S
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Kiligolo on October 22, 2010, 03:30:58 pm
Oh ok. ;D
Je crois que je ne me suis pas très bien exprimé...
Bon j'ai ceci comme code:
Code: [Select]
Input A
...
//Et là je voudrais faire une chose comme A->Str0 mais ERR:DATA TYPE...

Oh ok. ;D
I think I am not very well expressed...
So here is the program:

Code: [Select]
Input A
...
//Here, I would like to do something like A->Str0 but ERR:DATA TYPE...
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Munchor on October 22, 2010, 03:36:30 pm
Tu dois faire:

Code: [Select]
Input "", A
// Pour utiliser chaines

Code: [Select]
Input A
//Pour utiliser numeros
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Kiligolo on October 22, 2010, 03:44:28 pm
I would like to change a number into a string.
I know the input fonction. The code:
Code: [Select]
Input "NUMERATEUR:",A
Input "DENOMINATEUR:",B
Output(5,1,"CALCUL
lcm(A,B->C
//Here, I want to change the variable A into Str0
//The same with B and C
I am French so my English it a bit bad. ;D
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Munchor on October 22, 2010, 03:51:51 pm
oooh, transformer un numero pour une chaine:

Code: [Select]
:{0,1→L₁
:{0,N→L₂
:LinReg(ax+b) Y₁
:Equ►String(Y₁,Str1
:sub(Str1,1,length(Str1)-3→Str1
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Kiligolo on October 23, 2010, 02:47:46 pm
Are you sure? The calculator say ERR:DIM MISMATCH on "linReg(ax+b) Y1"... :(
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Kiligolo on October 24, 2010, 07:47:50 am
Personne pour m'aider ? :'(

Nobody is here to help me? :'(
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Runer112 on October 24, 2010, 07:59:03 am
oooh, transformer un numero pour une chaine:

Code: [Select]
:{0,1→L₁
:{0,N→L₂
:LinReg(ax+b) Y₁
:Equ►String(Y₁,Str1
:sub(Str1,1,length(Str1)-3→Str1

This is indeed the way to convert a number into a string, and this code should work. Are you sure you entered it correctly?
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Kiligolo on October 24, 2010, 08:08:19 am
It works!
Think you for your help! :D
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: DJ Omnimaga on October 24, 2010, 08:25:01 pm
Désolé j'aimerais bien aider mais malheureusement je ne suis pas très connaisseur en Axe et ayant quitté temporairement la programmation TI ça ne m'aide pas beaucoup :(
Title: Re: Chaine et variables (string and variable) [English/French]
Post by: Munchor on October 25, 2010, 07:33:59 am
oooh, transformer un numero pour une chaine:

Code: [Select]
:{0,1→L₁
:{0,N→L₂
:LinReg(ax+b) Y₁
:Equ►String(Y₁,Str1
:sub(Str1,1,length(Str1)-3→Str1

This is indeed the way to convert a number into a string, and this code should work. Are you sure you entered it correctly?

Yeah, this works very well for me too, but I see he already got it :)