Built-in functions from the insert
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
A receipt joins a number to text
- Every Paper 2 has an insert of built-in functions. Anything not in the pseudocode guide is printed there, and an answer may call it.
LEFT(Text, N)copies the firstNcharacters. Positions still start at 1.NUM_TO_STR(87.5)is the string"87.5". Join it with&when the line must contain words and a number.
한국어
영수증은 숫자를 텍스트에 연결함
- 모든 Paper 2에는 내장 함수 삽입물이 있습니다. 가상의 코드 가이드에 없는 것은 여기에 인쇄되며, 답안에서 이를 호출할 수 있습니다.
LEFT(Text, N)는 첫 번째N문자를 복사합니다. 위치는 여전히 1부터 시작합니다.NUM_TO_STR(87.5)는字符串"87.5"입니다. 줄에 단어와 숫자가 모두 포함되어야 할 때&과 연결하십시오.
OUTPUT LEFT("Computer", 3)
OUTPUT "Score: " & NUM_TO_STR(87.5)
English
Check before you convert
IS_NUM(Text)isTRUEonly when the string is a number."12a"isFALSE.STR_TO_NUM("23")is the number23, so you can add 1 to it. A string cannot be added.- Convert only after
IS_NUMsays the text is safe.
한국어
변환 전 확인
IS_NUM(Text)는字符串이 숫자일 때만TRUE입니다."12a"는FALSE입니다.STR_TO_NUM("23")은 숫자23이므로 1을 더할 수 있습니다. 문자열은 더할 수 없습니다.IS_NUM가 텍스트가 안전하다고 말한 후에만 변환하십시오.
DECLARE Text : STRING
Text ← "23"
IF IS_NUM(Text) THEN
OUTPUT STR_TO_NUM(Text) + 1
ELSE
OUTPUT "bad"
ENDIF
English
ASC and CHR
ASC("A")is the integer code65.CHR(66)is the character"B".- The next letter after
"A"isCHR(ASC("A") + 1).
한국어
ASC와 CHR
ASC("A")는 정수 코드65입니다.CHR(66)는字符"B"입니다."A"의 다음 글자는CHR(ASC("A") + 1)입니다.
OUTPUT CHR(ASC("A") + 1)
OUTPUT IS_NUM("12a")
English
Common mistakes
UCASEstill takes one character. A whole string in capitals isTO_UPPER, which you met earlier.NUM_TO_STRreturns text.STR_TO_NUMreturns a number. They are not interchangeable.
한국어
흔한 실수
UCASE는 여전히 한 문자를 받습니다. 대문자 전체 文字列은TO_UPPER이며, 이는 전에 배운 내용입니다.NUM_TO_STR는 文字列을 반환합니다.STR_TO_NUM은 숫자를 반환합니다. 서로 교체할 수 없습니다.
English
Now you try
- Use
LEFT, then a joined number, thenIS_NUMbefore a conversion.
한국어
이제 직접 해보기
- 변환 전에
LEFT, 연결된 숫자, 그리고IS_NUM을 사용하십시오.
Output LEFT("Computer", 3).
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Output Score: 87.5 on one line by joining the word and NUM_TO_STR(87.5) with &.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Text is "23". If IS_NUM(Text), output STR_TO_NUM(Text) + 1. Otherwise output bad.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.