ランダムな URL を取得する機能があります。
FUNCTION randurl : String;
BEGIN
// Randomize URL
Rx2 := RandomInt(4);
if (Rx = 0) then
result := 'www.site1.com'
else if (Rx2 = 1) then
result := 'www.site2.com'
else if (Rx2 = 2) then
result := 'www.site3.com'
else if (Rx2 = 3) then
result := 'www.site4.com';
END;
コンパイル中の文字列があります...
var Rx2 : integer;
{Declaration (Functions and Procedures)}
// Construct the GET String for the Web Script, call it and return the output
PROCEDURE update(status : String); forward;
BEGIN
// Message to display in twitter
statusmessage := '#Nowplaying ' + Song['artist'] + ' - ' + Song['title'] + ' @ ' + $FUNCTION_OUTPUT_VARIABLE + ' #' + Song['genre'];
update(statusmessage);
END;
END;
上記の $FUNCTION_OUTPUT_VARIABLE には、ランダムな URL を含める必要があります。関数を呼び出して、コードの各パスに出力を挿入するにはどうすればよいですか?
どうもありがとう!
編集:
上記の関数を使用して行ったソリューションを次に示します。
{Declaration (Variables)}
var Rx2 : integer;
FUNCTION randurl : String; forward;
BEGIN
// Message to display in twitter
statusmessage := '#Nowplaying ' + Song['artist'] + ' - ' + Song['title'] + ' @ ' + randurl + ' #' + Song['genre'];
update(statusmessage);
END;
END;