The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use relative path in script
#1
The following code can only use absolute paths, why? how to use relative path?

video demo:
https://www92.zippyshare.com/v/kPVvVYNc/file.html



C# code:
// script "edit.cs" /*/ ifRunning warn_restart; r Libraries\libxl\libxl.net.dll; resource example.xls; /*/ //.
using Au; using System;
using libxl;
partial class Script : AScript { [STAThread] static void Main(string[] a) => new Script(a); Script(string[] args) { //;;;

 
try
{                           
    Book book = new BinBook(); 
//    var s = "example.xls";
    var s = @"C:\Users\Administrator\Documents\Aedit\Main\files\libxl\example.xls";
    book.load(s);
    Sheet sheet = book.getSheet(0);
    double d = sheet.readNum(3, 1);
    sheet.writeNum(3, 1, d * 2);
    sheet.writeStr(4, 1, "new string");
//    var s2 = "example_ok.xls";
    var s2 = @"C:\Users\Administrator\Documents\Aedit\Main\files\libxl\example_ok.xls";
    book.save(s2);
}
catch (System.Exception e)
{
    Console.WriteLine(e.Message);
}  


}
}


Attached Files
.zip   libxl.zip (Size: 2.26 MB / Downloads: 223)


Messages In This Thread
use relative path in script - by macman - 01-12-2021, 10:41 AM
RE: use relative path in script - by Gintaras - 01-12-2021, 11:46 AM
RE: use relative path in script - by macman - 01-13-2021, 06:24 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)