The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
what is a string?
12-11-2013, 06:26 PM
Post: #1
what is a string?
I cannot find proper documentation in the user guide, but my understanding was that a string is a sequence of characters enclosed in quotation marks, like "1234"

Maybe someone knows: are the quotation marks part of the string?

I ask because programs like this, where one wants to use the output as the input for another program. For example

EXPORT bin(N)
BEGIN
LOCAL B:="";
WHILE N >0 DO
IF FP(N/2)=0 THEN B:=B+"0";
ELSE B:=B+"1";
END;
N:=IP(N/2);
END;
RETURN B;
END;

bin(N) returns the binary expansion of the integer N. In Home or CAS, bin(13) returns "1011" with quotation marks. Replacing RETURN B with PRINT B and running the program, returns 1011 to the output screen, without the quotation marks.

I hope someone knows what is going on here. Thank you.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
what is a string? - Alberto Candel - 12-11-2013 06:26 PM
RE: what is a string? - Han - 12-11-2013, 06:46 PM
RE: what is a string? - Alberto Candel - 12-11-2013, 07:11 PM
RE: what is a string? - Han - 12-11-2013, 07:29 PM
RE: what is a string? - Alberto Candel - 12-11-2013, 10:02 PM
RE: what is a string? - Han - 12-12-2013, 02:51 PM
RE: what is a string? - Alberto Candel - 12-13-2013, 08:27 AM
RE: what is a string? - Han - 12-13-2013, 02:33 PM



User(s) browsing this thread: 1 Guest(s)