Hier ist der Code für ein kleines Modul. Es macht nichts anderes als den Text Nothing to do... auszugeben. Allerdings erscheint es auch auf der Tool-Seite und demonstriert dort 2 Verschiedene Möglichkeiten der Ausgabe.

Kopieren Sie den Code in einen Texteditor und speichern Sie ihn als example.mod im Verzeichnis custprg ab. Übersetzen Sie dann das Programm mit der tdbengine in example.prg.

Code:

var cms_Version       : INTEGER  := 1
var cms_ModuleVersion : INTEGER  := 1
var cms_ShowModule    : STRING   := 'execmacro="Example",tool="Example"'
var cms_Functions_1   : STRING   := 'Help,tool,simple_show_output,Version 25.9.1'
var cms_Functions_2   : STRING   := 'Interactive_Help,tool,own_window,Version 25.9.1'
var cms_Functions_3   : STRING   := ''

include ../sysmod/cms_sub.mod

procedure cmsMain(nLfdWEB:INTEGER;cSpacer,cSes,cURL,cParam:STRING):STRING
  cms_nLfdWEB := nLfdWEB
  cms_cSpacer := cSpacer
  cms_cSes    := cSes
  cms_cURL    := cURL
  cms_cParam  := cParam
  ////
  cms_WriteText('Nothing to do...')
  ////
  Subst(cSpacer,'')
  Return cSes
endproc

procedure Help(cRamtext:STRING)
  var fh : INTEGER
  fh:=ReWrite(cRamtext)
  if fh>0
    WriteLn(fh,'Help for beispiel.mod<br>')
    WriteLn(fh,'<br>')
    WriteLn(fh,'Nothing to say...<br>')
    Close(fh)
  end
endproc

procedure Interactive_Help(cRamtext:STRING)
  var fh : INTEGER
  fh:=ReWrite(cRamtext)
  if fh>0
    WriteLn(fh,'Help for beispiel.mod<br>')
    WriteLn(fh,'<br>')
    WriteLn(fh,'Nothing to say...<br>')
    Close(fh)
  end
endproc

procedure Main
  var cSes : STRING
  cSes:=GetQueryString('sSession')
  if cms_CheckRecht(cSes,'sysop')#'1'
    CgiWriteLn("content-type: text/plain")
    CgiWriteLn("")
    CgiWriteLn("Only for sysop")
  else
    if GetQueryString('function')='Interactive_Help'
      CgiWriteLn("content-type: text/html")
      CgiWriteLn("")
      // do something...
      // ...
      // ...
    else
      CgiWriteLn("content-type: text/plain")
      CgiWriteLn("")
      CgiWriteLn("Unknown function")
    end
  end
endproc
 
eforia® web manager Dokumentation
Stand V 3.01 / 20.12.2010
© Horst Klier
http://www.klier.net
Impressum