HyperTalk
Penampilan
HyperTalk adalah bahasa pengaturcaraan aras tinggi direka pada tahun 1987 oleh Dan Winkler dan digunakan bersama dengan Apple Computer aturcara hipermedia HyperCard oleh Bill Atkinson. Sasaran utama HyperTalk merupakan pengatucara baru, dengan itu pengaturcara HyperTalk biasanya dikenali sebagai pengarang, dan keseluruhan proses menulis aturcara dikenali sebagai "menulis skrip". Skrip HyperTalk menyerupai bahasa Inggeris,dan menggunakan struktur logik sama seperti bahasa pengaturcaraan Pascal.
Contoh skrip
[sunting | sunting sumber]
on mouseUp
put "100,100" into pos
repeat with x = 1 to the number of card buttons
set the location of card button x to pos
add 15 to item 1 of pos
end repeat
end mouseUp
on mouseDown
put "Disk:Folder:MyFile" into filePath -- no need to declare variables
if there is a file filePath then
open file filePath
read from file filePath until return
put it into cd fld "some field"
close file filePath
set the textStyle of character 1 to 10 of card field "some field" to bold
end if
end mouseDown
function replaceStr pattern,newStr,inStr
repeat while pattern is in inStr
put offset(pattern,inStr) into pos
put newStr into character pos to (pos +the length of pattern)-1 of inStr
end repeat
return inStr
end replaceStr
Lihat juga
[sunting | sunting sumber]- Natural Inform - Inform 7, a programming language with similarly English-like syntax
- Pantechnicon HyperTalk Wiki pages Diarkibkan 2006-09-26 di Wayback Machine - excellent language reference (control structures, events, built-in functions, etc.)