single (Dual Argument) string

Share your advanced PureBasic knowledge/code with the community.
User avatar
J. Baker
Addict
Addict
Posts: 2188
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

single (Dual Argument) string

Post by J. Baker »

Code updated for 5.20+

the window to call the dll

Code: Select all

If OpenWindow(0, 100, 100, 200, 200, "System Beep", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)

 If OpenLibrary(0, "beep.dll")
  CallFunction(0, "systembeep", @"1500, 1000")
  CloseLibrary(0)
 EndIf

EndIf

End
the dll

Code: Select all

ProcedureDLL.s systembeep(getArgs$)

  getCommaPos = FindString(getArgs$, ",", 1)
  
  Arg1$ = RSet(getArgs$, getCommaPos -1)
  
  Arg2$ = RemoveString(getArgs$, Arg1$ + ",")
  
  hertz = Val(Arg1$)
  
  milliseconds = Val(Arg2$)
  
  Beep_(hertz , milliseconds)
  
 ProcedureReturn
EndProcedure
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.