⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 docunsch.ssc

📁 PowerBuilder8.0开发分散式应用所帶的例程
💻 SSC
字号:
<!--SCRIPT PSOBJMOD
    import( site.GetRootDocument().location + "/ObjMod80.ssc" );
    session.active = true;
    InitObjects(session);
-->
<!--SCRIPT // {{ SCRIPT()
/* Remove a document from the scheduled list */

var webRoot = site.GetRootDocument();
import ( webRoot.location + '/system/utils/strtable.ssc' );

// First check that the document has file extension .ssc or .stm
var docname = document.location;
var result = false;
var index = docname.lastIndexOf( '.' );
if( index != -1 ) {
  var extension = docname.substring( index + 1, docname.length );
  if( extension == 'ssc' || extension == 'stm' ) {
    result = true;
  }
}
if( !result ) {
  document.writeln( IntlStr.wizUnsched.mustBeScript );
  return;
}

// Change the file extension
var fullname = docname.substring( 0, docname.length - 1 ) + 's';

// Restore the script under the original name

var origDoc = site.GetDocument( fullname );
if( origDoc == null ) {
  document.writeln( formatString( IntlStr.wizUnsched.mayNotBeSched, fullname ) );
  return;
}

// Set the source of the original document (the first SCRIPT section was
// added by the scheduling script, so strip it off)

var endtag = '--' + '>\r\n';
index = origDoc.source.indexOf( endtag );
document.source = origDoc.source.substring( index + endtag.length, origDoc.source.length );

// Release the sts/sss file so that it can be deleted

origDoc = null;

// Delete the sts/sss file

site.DeleteDocument( fullname );

// Remove the entry from schedule.ssc

var webroot = site.GetRootDocument();
var schedulename = webroot.location + '/system/schedule.ssc';
var scheduledoc = site.GetDocument( schedulename );
  
if( scheduledoc != null ) {
  var relativeName = fullname;
  if( fullname.indexOf( webroot.location ) != -1 ) {
    var relativeName = fullname.substring( webroot.location.length, fullname.length );
  }
  var searchtext = '  site.Schedule( site.GetRootDocument().location + "'
      + relativeName + '"';
  index = scheduledoc.source.indexOf( searchtext );
  // search to the end of the line
  var endindex = scheduledoc.source.indexOf( '\r\n', index + searchtext.length );
  scheduledoc.source = scheduledoc.source.substring( 0, index )
    + scheduledoc.source.substring( endindex + 1, scheduledoc.source.length );  
}
// }}
-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -