demo issues

Started by James C. Fuller, March 15, 2024, 12:23:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

James C. Fuller

  Just poking around the demos with the latest: 0.7.0 2024-03-10

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

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

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

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

Error(s) occured.

Charles Pegge

Thanks James,

I have reworked this example:

  word wYear,
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
  if locl
    GetLocalTime t
    GetSystemTime t
  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)

Roland Stowasser

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?

Charles Pegge

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
end macro

I will fix this compiler problem properly in the next update.

Roland Stowasser

Hi Charles,

thank you for the updated 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.