NTK and The NTK Project
are properties of Jn Dechereux
Home | Documentation | FAQ.

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentTimeJul 7th 2021
    Hi group,
    I have a silly little(?) problem. I'm using a new PC and Win10 Home. I now cannot create sounds with the TONE function, however it works with older PCs/Clipper Apps. Any idea?
    • CommentTimeJul 7th 2021
    Hi Hans,

    Tone is a console/nogui func, so just try adding this line at the top of your PRG:

    REQUEST HB_GT_GUI_DEFAULT // We want to hear tone()

    • CommentTimeJul 8th 2021 edited
    Hi HansB

    As a good substitue for TONE() in GUI environement, you can also use this code:
    STATIC FUNCTION MyTONE( nFreq, nDuration )  // Remember in Clipper-Dos nDuration was
    RETURN( Beep(nFreq, (nDuration/18)*1000) )  // specified in units of 1/18th of a second.
    _DLL FUNCTION BEEP( dwFreq as INT,;       // The frequency of the sound, in hertz. Must be in the range 37 through 32,767.
                        dwDuration as INT );  // The duration of the sound, in milliseconds.
                  AS INT  Pascal:KERNEL32.Beep

    Btw, you'll find more details in TONE.PRG demo in ..\Contribs\ folder.
    Hope this helps.
    • CommentTimeJul 9th 2021
    Many thx AB & Chris for answers.
    I've tried both solutions and each of them works perfectly.
    Finaly, I've fixed the TONE() problem with the last 2 functions from Chris & "the gold mine' found in Tone.Prg ( =>Tone [renamed MyTone]).
    I've also changed a header file by adding #translate Tone( <list,...> ) =>   ( MyTone( <list> ) )
    So all is well now. Many thanks for your help.