GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | INSTR

Edit History

INSTR

pos = INSTR ([start,] s1, s2)

Home > Reference > String

Returns the position pos of the first occurrence of the string s2 in string s1 (starting from the position start). If there is no match, INSTR returns 0.

Example 1: Get position starting a the beginning of the string

s1 = "abcdef"
s2 = "cd"
print instr(s1, s2)  ' Output 3

Example 2: Get position using a starting point

s1 = "abcdefabcd"
s2 = "ab"
print instr(3, s1, s2)  ' Output: 7  (instead of 1)
Code samples using INSTR
biorythms.bas   blackjack.bas   BlackJack.bas   bolmo.bas   bulls and cows.bas   calc.bas   dia de una fecha.bas   dmsareareadmd.bas   dogstar5.bas   filemanager.bas   g2 Life.bas   g3 Life.bas   g4 Life.bas   g5 Life.bas   g6 Life.bas   hangman v2.bas   hangman.bas   irc-bot.bas   lander.bas   lib-gputmcon.bas   mandala life.bas   Mandala life.bas   mandelbrot explorer.bas   mastermind.bas   memory match game.bas   memoryTest.bas   memorytest.bas   new bas.bas   new help.bas  
String
ASC   BCS   BIN   CBS   CHOP   CHR   DISCLOSE   ENCLOSE   FORMAT   HEX   INSTR   JOIN   LCASE   LEFT   LEFTOF   LEFTOFLAST   LOWER   LTRIM   MID   OCT   REPLACE   RIGHT   RIGHTOF   RIGHTOFLAST   RINSTR   RTRIM   SINPUT   SPACE   SPC   SPLIT   SPRINT   SQUEEZE   STR   STRING   TRANSLATE   TRIM   UCASE   UPPER   VAL  
This page was last edited on Wed, 19 Apr 2023 15:22:02 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.