← All courses

Strings and Text

Read, clean and build text

Clean scanner codes, compare labels, build operator messages with fixed digits, read numbers out of device replies, and check a message checksum.

  1. 0

    Shows a new message on a display that reads every byte of the STRING, so nothing of the old one is left.

    Display New Text

    EXERCISE
    Difficultyeasy
    Statusunknown
  2. 1

    Removes the carriage return a barcode scanner adds to the end of each code.

    Strip the Terminator

    EXERCISE
    Difficultyeasy
    Statusunknown
  3. 2

    Compares a printed label with the expected text and reports why they differ.

    Check the Label

    EXERCISE
    Difficultymedium
    Statusunknown
  4. 3

    Builds a laser marker's serial number, 'SN-0042', from a counter.

    Serial Number Text

    EXERCISE
    Difficultymedium
    Statusunknown
  5. 4

    Prints a weight with exactly one decimal place, '12.4' and not '12.3999996'.

    Weight With One Decimal

    EXERCISE
    Difficultymedium
    Statusunknown
  6. 5

    Turns the controller's date and time into an operator message with AM or PM.

    Timestamp Message

    EXERCISE
    Difficultymedium
    Statusunknown
  7. 6

    Reads a setpoint and an actual value from a controller reply such as 'fg500-34900'.

    Two Numbers From a Reply

    EXERCISE
    Difficultymedium
    Statusunknown
  8. 7

    Looks up a scanned code in a table of recipe codes and reports its line speed.

    Find the Recipe

    EXERCISE
    Difficultymedium
    Statusunknown
  9. 8

    Turns the bytes a barcode scanner sends into a STRING without its carriage return.

    Scanner Bytes to Text

    EXERCISE
    Difficultymedium
    Statusunknown
  10. 9

    Writes a byte as two hex digits, 244 as 'F4' and 10 as '0A'.

    Byte to Hex Text

    EXERCISE
    Difficultymedium
    Statusunknown
  11. 10

    Shows a temperature with its sign and one decimal place, -12.5 as '-12.5' and -0.5 as '-0.5'.

    Temperature With Sign

    EXERCISE
    Difficultymedium
    Statusunknown
  12. 11

    Splits a comma-separated reply from a weld controller into five REAL values.

    Split a CSV Reply

    EXERCISE
    Difficultyhard
    Statusunknown
  13. 12

    Reads a number a device sends as hex text, such as 'A1C8', and rejects text that is not hex.

    Hex Text to Number

    EXERCISE
    Difficultyhard
    Statusunknown
  14. 13

    Checks the checksum at the end of a GPS sentence before its data is used.

    Check a Message Checksum

    EXERCISE
    Difficultyhard
    Statusunknown
  15. End