Interactive PowerBasic Forum

IT-Consultant: Charles Pegge => OxygenBasic => Topic started by: James C. Fuller on March 15, 2024, 12:23:22 PM

Title: demo issues
Post by: James C. Fuller on March 15, 2024, 12:23:22 PM
Charles,
  Just poking around the demos with the latest: 0.7.0 2024-03-10
James


cO2m64 -m -64 D:\OxygenBasic\demos\System\SystemTime

ERROR: parameters mismatch for procedure mid_
params given : #string#long@00

OPTIONS:
mid_(gstr_,sys,gstr_) returns sys
mid_(cstr_,sys,gstr_) returns sys


WORD: -
COL: 23
LINE: 21
FILE: "d:\oxygenbasic\demos\system\systemtime.o2bas"

Error(s) occured.

Title: Re: demo issues
Post by: Charles Pegge on March 15, 2024, 03:02:41 PM
Thanks James,

I have reworked this example:

type SYSTEMTIME
  word wYear,
       wMonth,
       wDayOfWeek,
       wDay,
       wHour,
       wMinute,
       wSecond,
       wMilliseconds
end type

extern lib "kernel32.dll"
!  GetSystemTime (SYSTEMTIME*lpSystemTime)
!  GetLocalTime  (SYSTEMTIME*lpSystemTime)
end extern


function timestr (int locl=0) as string
=======================================
  '
  function f (word v) as string
  -----------------------------
    return mid( "0"+str(v) , -2)
  end function
  '
  function  m (word v) as string
  ------------------------------
    return mid("00"+str(v), -3)
  end function
  '
  SYSTEMTIME t
  if locl
    GetLocalTime t
  else
    GetSystemTime t
  endif
  return str(t.wYear) "." + f(t.wMonth) "." f(t.wDay) " " +
  f(t.wHour) ":" f(t.wMinute) ":" f(t.wSecond) +
  "." str(t.wMilliseconds)
end function

print "System DateTime: " timestr()
print "Local DateTime: " timestr(1)

Title: Re: demo issues
Post by: Roland Stowasser on May 09, 2024, 02:40:00 PM
Hi Charles,

there is a small problem with /demos/Sound/KeyBoardMidi.o2bas. This app runs fine with oxygen.dll 07P10 (version 0.7.0 2024-01-01T14:45:45 32bit), but with the oxygen.dll in progress (version 0.70 2024-03-19T 10:02:07 32bit) I get this error message:

ERROR : not found
WORD:  r
PROC:    createThemenu
COL:      1
LINE:      422
FILE:      main source

This is a strange error message. If I comment out the createThemenu procedure the message happens in a different place. So I think there is something missing with oxygen.dll? Maybe I am using a version that is not up to date?
Title: Re: demo issues
Post by: Charles Pegge on May 09, 2024, 04:02:52 PM
Thanks Roland,

This is a case-sensitivity issue affecting the iif macro in the program

Here is a quick fix:

macro iif int(r, a,b,c)
'if A then R=B else R=C
if a
  r=b
else
  r=c
endif
end macro

I will fix this compiler problem properly in the next update.
Title: Re: demo issues
Post by: Roland Stowasser on May 11, 2024, 10:19:30 AM
Hi Charles,

thank you for the updated Oxygenbasic.zip. I only checked on Github today because I did not expect this to happen so quickly. Currently, I am trying to revise an older project that uses some macros which involve uppercase and lowercase letters. I think it is quite good that I do not have to change this writing style.