Re: progress while binding libxl

2017-10-25 Thread wizzardx
May be better to try to make your own really basic wrapper in the meanwhile, and put that in github For some ideas and inspiration you can watch the "c2nim" section of Araq's 2 hour Nim Workshop YouTube vid

Re: progress while binding libxl

2017-10-24 Thread alfrednewman
@wizzardx, I think it is possible to do so... but considering that @oyster has supposedly already started a wrapper process with libxl, I figured we could contribute something to it.

Re: progress while binding libxl

2017-10-22 Thread wizzardx
@alfrednewman It might be possible to wrap a Python XLS library in Nim?. It's an approach I'm considering for some python libs I'm having trouble porting to Nim due to my lack of low-level C coding ability - eg Pyglet. It's not entirely unprecedented, Haskell also wraps some awesome python libs

Re: progress while binding libxl

2017-10-21 Thread alfrednewman
Hello @oyster Ssorry to ask, but how is the process going with the libxl binding ? I need to work with a project where reading and writing Excel files will be an important prerequisite ... figuring that there is not yet a component in Nim to get the job done, I will have to perform the delivery

Re: progress while binding libxl

2017-06-23 Thread Stefan_Salewski
> still be Greek for me. Well, the when statement is really easy to understand and well explained in the manual, so maybe you should read it again. It is good to understand it. What you may be looking for is a converter, see manual. A converter allows automatic conversion of proc parameter type

Re: progress while binding libxl

2017-06-23 Thread oyster
Thanks, LeuGim. **`When`** does work. However [https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement](https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement) still be Greek for me. * * * more question I, a lazy none programmer practitioner, met

Re: progress while binding libxl

2017-06-22 Thread LeuGim
That code doesn't always think the value is not `WideCString`, just it has both "then" and "else" clauses to compile, and it has no appropriate version of `convert`, when `value` is `WideCString`. You can derive it by just commenting out the line with `convert`, to make the code compile - "not w

Re: progress while binding libxl

2017-06-21 Thread oyster
thanks, and I found echo type("text") is string

Re: progress while binding libxl

2017-06-21 Thread Stefan_Salewski
Sorry, no idea for your widecstring and unicode questions. How is that handled from C? Your cint conversion should be not necessary, the compiler will pass int literals correctly to library functions, so xlSheetWriteStrW(sheet, 2, 1, #xlSheetWriteStrW(sheet, cint(2), cint(1),

Re: progress while binding libxl

2017-06-21 Thread oyster
this is what I get currently. Most functions in libxl can be exposed in the same way But something still puzzled me, or I have not know yet in nim: 1. for xlBookAddSheetW, the last arg is SheetHandle initSheet actually. But I used int. How to cast a number to SheetHandle? 2. how to judge th

Re: progress while binding libxl

2017-06-21 Thread Stefan_Salewski
> So I started this binding work on June 18th 2017. While c2nim does a very good job in binding generation, it is helpful if one has some C knowledge and additional has a basic understanding of the library to wrap, because it can be hard to guess what C header files really intent.

Re: progress while binding libxl

2017-06-21 Thread oyster
the first question, I translated typedef struct tagBookHandle * BookHandle; to type tagBookHandle* {.final, incompleteStruct, importc: "tagBookHandle".} = object BookHandle* {.importc: "BookHandle".} = ptr tagBookHandle Am I right? Bu

progress while binding libxl

2017-06-21 Thread oyster
This post is related to [https://forum.nim-lang.org/t/2977/2](https://forum.nim-lang.org/t/2977/2), in which I said "For commercial products to read/write XLS/XLSX, I found [http://libxl.com/](http://libxl.com/)" So I started this binding work on June 18th 2017. However I am totally newbee in