This is part of the HicEst documentation

Examples: 1-liners that can be combined to a script


All example statements can be executed directly in HicEst. Just paste and copy to a script window. Try and change. Discover ease and power of operation.

⇾Home ⇾Contents ⇾more General ⇾ Examples
numeric text in/out program
how to define and set a numeric variable how to define a character variable how to edit a variable ⇾ get help
recording desk calculator how to set a string how to graph a coordinate system how to make a comment
how to get the number pi how to locate an approximate string using Regular Expression how to draw lines to a graph how to debug without a breakpoint
how to transform date and times how to join 2 strings with n spaces how to maximize or minimize a window how to debug with a trace or break point
how to swap 2 variables how to find short in long how to multi use the script window how to recover after a crash
how to set a string from its substrings how to handle a messagebox how to get the current time
how to scan a txt for one of a multitude of letters how to write text to titlebar and taskbar how to define a label
how to search a string for a substring matching a specified pattern how to write formatted to a string how to delay wait quit
how to write a protocol with strings of varying lengths (CSV) how to sequentially read or write a disk file how to program a loop
how to locate the last \ in a string how to stream-io a disk file how to if then else endif
how to insert a string to a list and case-sensitive eliminate doubles how to read a CSV file item by item how to make the script wait a while
how to multiple repeat a string how to edit a CSV file how to check for keyboard activity
how to replace a string in a text multiple times how to read element(i,j) from a CSV-file how to make execution jumps
how to insert a string in text how to read a file and close it how to call a subroutine
how to delete a string in text how to extract numbers from a text string how to define a subroutine
how to kerning a text how to write time formatted how to define a function procedure
how to read or write a complete file at one go how to make sorted directory file lists
how to hand over a filename to Windows to handle it (Shell command) how to read the file time
how to design very long dialogs how to rename a file
how to define procedures to be called asynchronously
how to delete a disk file
how to list all files of the current directory
how to list all base directories of all drives
how to open a file for matrix explorer using a filter
how to call matrix explorer with row radio buttons for callback
how to read a single element from an opened CSV-file
how to make a call from a message box
how to combine scalar variables to an array
how to determine how many elements were read from a list
how to handle multiple logical conditions
how to call a Windows API or another Dynamic Link Library dll




Bookmarks:
⇾barometric_formula ⇾basic_examples ⇾countdown_timer ⇾more_examples ⇾rename_photos
A few example scripts are part of the Download files:
A few very
basic_examples

(To find out more try the embedded links)
  1. how to define and set a numeric variable x:
    x = 3.1415 ! No extra definition needed 3.1415
  2. how to make a comment
  3. how to define a character variable string:
  4. how to set a string
    string = "many ways are possible to do this" many way
  5. how to edit a variable. Variable is a string, a numeric, or an array:
  6. use as a recording desk calculator. Type, hit Enter, see result:
    123.4 + 1/4 - 100 23.65
    length = 12.3 + 0.12 - 2 ! defines a variable "length" 10.42
    area = length * length 108.5764
  7. how to debug without a breakpoint. See Debugging for more.
  8. how to debug with a trace or break point. Debugging for more.
  9. how to recover after a crash
  10. how to get the current time
    s = TIME() s = TIME( TO, MInute=m, Hour=h, YYYYMMDD=txt )
    seconds since 0:00 m, h, txt have current time
  11. how to get the number pi
    pi = ACOS(-1) 3.141593
  12. how to define a label (a target for program jumps, use sparingly).
    123 x = pi + 1 ! A leading constant with no operator is a label 4.141593

  13. how to graph a coordinate system. Many options, see AXIS
  14. how to draw lines to a graph. Axis must have been called, see LINE
  15. how to delay wait quit
    ALARM( 1 ) ALARM( 5, 4 ) ALARM( 999 )
    wait for keyboard, mouse, or alarm event in 5 seconds call F4 quit immediately

  16. how to maximize or minimize a window
    WINDOW(MAXImize=wh) WINDOW(NORMal=wh) WINDOW(MINImize=wh)
    wh = windowhandle (wh = 0: script window) restore original size
    • WRITE(TitleBar) TXT ! TXT shows in taskbar AND titlebar
  17. how to multi use the script window
  18. how to handle a messagebox ⇾ details
  19. how to program a loop
  20. how to if then else endif ! expression (numeric or text) controls execution.
  21. how to write text to titlebar and taskbar
  22. how to make the script wait a while
  23. how to check for keyboard activity
  24. how to write formatted to a string
  25. how to make execution jumps. Convenient, but poor programming practice.
  26. how to call a subroutine
  27. how to define a subroutine
  28. how to define a function procedure
  29. how to make sorted directory file lists. The lists are examples of CSV-lists: ! oldList is a "Comma Separated Values" CSV-list. Quotes enclose texts e.g.
  30. how to sequentially read or write a disk file for READ and WRITE
  31. how to stream-io a disk file to read or write any length chunks
  32. how to read a CSV file item by item: special characters separate items recurringly
  33. how to edit a CSV file. The file oldList was OPENed for to " separated columns:
  34. how to read element(i,j) from a CSV-file
  35. how to read a file and close it. The file must have been OPENed appropriately.
  36. how to locate an approximate string using Regular Expression
    idx = INDEX(txt, "201\d:", 128) ! search "201d:" (\d means 1 digit, 128 is RegEx) 588
  37. how to extract numbers from a text string
  38. how to transform date and times. Get average days per year:
    TIME(YYYYMMDD=24000101, TO, Grg=Jan1_2400) ! shows sec since 0:00 68042.22
    TIME(Day=1, MOnth=1, Year=2000, TO, Gregorian=Jan1_2000) 68019.1
    average = (Jan1_2400 - Jan1_2000) / 400 ! Gregorian leap year formula 365.2425
  39. how to read the file time. This is the last-write time.
  40. how to write time formatted. e.g. t = 43202.3090277778 (t = 0 writes current t)
  41. how to join 2 strings with n spaces. The Join operator does it:
    joined = "aA" && "bB" ! && joins with 1 space aA bB
  42. how to rename a file
  43. how to find short in long. txt in TEXT or number in ARRAY:
    Idx = INDEX("ABCDE", "cd") ! options possible 3
    idx = INDEX( (11,12,13,14), 12.34, 32) ! option best match = 32 2
  44. how to set a string from its substrings, eg pp="ping-pong"
  45. how to define procedures to be called asynchronously like F2 or F3
  46. how to delete a disk file
  47. how to list all files of the current directory
  48. how to list all base directories of all drives
  49. how to open a file for matrix explorer using a filter
  50. how to call matrix explorer with row radio buttons for callback
  51. how to read a single element from an opened CSV-file
  52. how to make a call from a message box
  53. how to combine scalar variables to an array
  54. how to determine how many elements were read from a list
  55. how to scan a txt for one of a multitude of letters
      • idx = INDEX(txt, "3ax7?", 8) ! idx points to 1st occurrence of any of "3ax7?"
      • EDIT(Text=txt, Option=8, Right="3ax7?", Delete=2,...) ! if additional action is required (delete,etc)
  56. how to handle multiple logical conditions
  57. how to read or write a complete file at one go
  58. how to search a string for a substring matching a specified pattern: Regular Expression
  59. how to write a protocol with strings of varying lengths (CSV)
  60. how to hand over a filename to Windows to handle it (Shell command)
  61. how to locate the last \ in a string
  62. how to insert a string to a list and case-sensitive eliminate doubles
  63. how to design very long dialogs: too big to fit to 1 statement line
  64. how to call a Windows API or another Dynamic Link Library dll
    Here are a few that did not make it to a combined script:
  65. how to swap 2 variables
  66. how to multiple repeat a string
    string = &("ab") ! see Join operator abababab
  67. how to replace a string in a text multiple times, eg "c" by "**" in LT="Character"
  68. how to insert a string in text, eg "??" after "c" in LT="Character":
  69. how to delete a string in text, eg "??" in LT="C??harac??ter":
  70. how to kerning a text (insert 1 space between characters ( Join, InlineLoop )
    text = &&( "original"( $1) ) o r i g



Support HicEst   ⇾ Impressum
©2000-2019 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.