Deprecated: Array and string offset access syntax with curly braces is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Subs.php on line 3825
Recent Posts

Recent Posts

Pages: 1 2 3 4 5 6 7 8 9 10
1
OxygenBasic / Re: Help on Help
« Last post by Nicola_Piano on Today at 04:47:34 PM »
ok, then i will correct the example that is on the help.
Ciao
2
OxygenBasic / Re: Help on Help
« Last post by Charles Pegge on June 28, 2022, 05:38:08 PM »
In the early days, autodim was the default. This makes short demo code easier but it's a serious hazard for any project of significant scale.
3
OxygenBasic / Re: Error on stringutil.inc?
« Last post by Charles Pegge on June 28, 2022, 05:33:11 PM »
Ah yes, I cleaned up StringUtil.inc. Some of it was to solve a Rosetta code task but it was too specific for library code.

4
OxygenBasic / Re: Help on Help
« Last post by Nicola_Piano on June 28, 2022, 05:05:39 PM »
Code: [Select]
dim string r
type vt long v,double d
dim as vt v
r=recordof v
print r

now it looks like it's ok.
thanks charles

result is
Code: [Select]
983
16
8892
0
0
983
0
0
v
[ebx+8892]

vt
5
OxygenBasic / Re: Error on stringutil.inc?
« Last post by Nicola_Piano on June 28, 2022, 04:55:57 PM »
Great thing Charles,
but perhaps a broad revision is needed?
Unfortunately, doing a test I get an error.

Code: [Select]
use parseutil.inc
string s="Hi Charles"

print getword(s,2)

Anyway, the program description is great that way.
6
OxygenBasic / Re: Error on stringutil.inc?
« Last post by Charles Pegge on June 28, 2022, 02:33:15 PM »
Hi Nicola,

A reviewed and annotated ParseUtil.inc:
7
OxygenBasic / Re: Help on Help
« Last post by Charles Pegge on June 27, 2022, 02:40:41 PM »
Hi Nicola,

without #autodim enabled, r needs to be: dim as string r.

this is a current list of all the attributes from oxsc\lang.inc
Code: [Select]
sizeof      11 1  4
offsetof    11 2  4
countof     11 3  4
spanof      11 3  4
bytesof     11 4  4
typeof      11 5  193
structureof 11 6  193
encodingof  11 6  193
prototypeof 11 7  193
typecodeof  11 8  4
recordof    11 9  4
widthof     11 10 4
ptrlevelof  11 11 4
metatypeof  11 12 193
strptr      11 21 8
lpartof     11 31 0
rpartof     11 32 0
vtypeof     11 33 0
8
OxygenBasic / Re: Error on stringutil.inc?
« Last post by Charles Pegge on June 27, 2022, 01:11:14 PM »
Here is a sample: - playing with markup styles

function instrword(string s,k) as int

  to find whole words in a string

  Parameters:
  s is the string to be searched
  k is the keyword to be located in s

  Return:
 the index of the first position of k in s

  if the search fails then the return value is 0


function instrword(string s,k) as int
=====================================
/**
  to find whole words in a string

  @param s is the string to be searched
  @param k is the keyword to be located in s
  @return the index of the first position of k in s

  if the search fails then the return value is 0
**/

int  lk=len k
int ,lb,rb
byte b at strptr(s)
if not k then return 0
int i=1
do
  i=instr(i,s,k)
  if i=0
    return 0
  endif
  lb=i-1
  rb=i+lk
  if b[ rb ]<48
    if i=1
      return 1
    elseif b[ lb ]<48
      return i
    endif
  endif
  i+=lk
loop
end function
9
OxygenBasic / Re: Help on Help
« Last post by Nicola_Piano on June 27, 2022, 12:16:48 PM »
Dear Charles,
i was updating the help and i noticed that the examples related to
STRUCTUREOF
ENCODINGOF
RECORDOF
don't work.

Error: not defined
Word: r
line: 2

Code: [Select]
type vt long v,double d
dim as vt v : r=recordof v
10
OxygenBasic / Re: Error on stringutil.inc?
« Last post by Nicola_Piano on June 26, 2022, 09:23:17 AM »
Hi Charles,
excellent idea of ​​using Doxygen. I read something from the link you entered.
In this way the source file would have all the notes necessary to explain it and, at the same time, could be used to create its part in the HELP.
Pages: 1 2 3 4 5 6 7 8 9 10