Execute B4P Statements Interactively

Prev Next

Introduction

In interactive mode, you can enter any valid B4P program statement which will be executed immediately after pressing the [Enter] key. You are able to specfify multiple statements (example: for (a[]=1, a[]<5, a[]++) echo(a[]); echo(Done.)) in one line and they will be executed like a small B4P program. Even angular braces { ... } are allowed here to put multiple statements into one block.

A semicolon is not required at the end of the last statement entered interactively.

>> a[] = 5
>> b[] = 3; echo( a[]*b[] + 5)
20
>> for (a[] = 1, a[]<=5, a[]++) print (a[]," "); echo(Done.)
1 2 3 4 5 Done.   
>> echo( average( 1,2,3,4 ) )
2.5
>> table load ( t, 'Examples\Cities.csv' )
>> echo( [t: City, Boston, 'State/Province' ])
Massachusetts
>> exit // Leave B4P