UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

1-86 UniBasic Commands Reference Return Code Status 1 Invalid request handle. 2 Invalid parameter. 3 Bad content type. addRequestParameter Return Codes (continued) Note: For a GET request, content_handling is ignored. For a POST request with default content type, the default for content_handling is “Content-Type:text/plain” if content_handling is not specified. For a POST request with “Multipart/*” content-type, content_handling is a dynamic array containing Content-* strings separated by field marks (@FM). They will be included in the multipart message before the data contained in parameter_value is sent. An example of content_handling: Content-Type: application/XML @FM Content-Dispostion: attachment; file=”C:\drive\test.dat” @FM Content-Length: 1923 Specifically, for a POST request with content type “multipart/form-data”, a “Content-Dispostion: form-data” header will be created (or, in the case of Content- Dispostion already in content_handling, “form-data” will be added to it). For both a GET and a POST request with either no content type specified or specified as “application/x-www-form-urlencoded”, as described in createRequest(), URL encoding is performed on data in parameter_value automatically. Basically, any character other than alpha-numeric is considered “unsafe” and will be replaced by %HH where HH is the ASCII value of the character in question. For example, ‘#’ is replaced by %23, and ‘/’ is replaced by %2F, etc.. One exception is that by convention, spaces (‘ ‘) are converted into ‘+’. For a POST method with other MIME-type specified, no encoding is done on data contained in parameter_value.

ALPHA Syntax ALPHA("str.expr") Description The UniBasic ALPHA function tests a string to see if it is composed entirely of alphabetic characters. If str.expr is made entirely of alphabetic characters (not special characters, escape sequences, or the null value), the function returns 1. If numeric or other characters are present in str.expr, or if str.expr evaluates to an empty string or the null value, the function returns 0. Because UniBasic does not recognize multibyte characters as alphabetic, ALPHA returns 0 instead of converting them. Examples In the following example, the program statement prints 0 because the literal string contains the numeric character 2: PRINT ALPHA("ABCDEFGHIJK2") In the next example, the program segment prints 1 because the string ALPHA contains only alphabetic characters: ALPHA.T=ALPHA("CORONA") PRINT ALPHA.T In the next example, the program statement prints 0 because the string does not contain any characters. An empty string is not considered to be an alphabetic character. PRINT ALPHA("") ALPHA 1-87

ALPHA<br />

Syntax<br />

ALPHA("str.expr")<br />

Description<br />

The <strong>UniBasic</strong> ALPHA function tests a string to see if it is composed entirely of<br />

alphabetic characters. If str.expr is made entirely of alphabetic characters (not special<br />

characters, escape sequences, or the null value), the function returns 1. If numeric or<br />

other characters are present in str.expr, or if str.expr evaluates to an empty string or<br />

the null value, the function returns 0.<br />

Because <strong>UniBasic</strong> does not recognize multibyte characters as alphabetic, ALPHA<br />

returns 0 instead of converting them.<br />

Examples<br />

In the following example, the program statement prints 0 because the literal string<br />

contains the numeric character 2:<br />

PRINT ALPHA("ABCDEFGHIJK2")<br />

In the next example, the program segment prints 1 because the string ALPHA<br />

contains only alphabetic characters:<br />

ALPHA.T=ALPHA("CORONA")<br />

PRINT ALPHA.T<br />

In the next example, the program statement prints 0 because the string does not<br />

contain any characters. An empty string is not considered to be an alphabetic<br />

character.<br />

PRINT ALPHA("")<br />

ALPHA 1-87

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!