Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - mostlywrong

#1
newLISP and the O.S. /
February 12, 2009, 01:22:49 PM
sorry it looks like I dropped an S on the words strings in that sentence.  



I am trying to understand what the differences between LPCSTR LPWSTR LPCWSTR.



How Utf-8 relates to it (because there is a utf-8 newlisp)



The desire to do the project that i first had in mind is a lot smaller now, but I would like get a little working knowledge of how to pass and convert to and from unicode.
#2
newLISP and the O.S. /
February 11, 2009, 06:12:48 PM
ok, real question. windows does not Do utf-8?



it looks like the string in unicode are all 16bit unicode. how does that mesh with newlisps utf-8 ?
#3
newLISP and the O.S. /
February 11, 2009, 12:47:32 PM
Its never something easy is it.     :-)



edit:

Well now i know (sorta) what "LPCSTR" "LPWSTR" "LPCWSTR" is and i cant really think of anything constructive to say.


Quotehttp://msdn.microsoft.com/en-us/library/cc245847%28PROT.10%29.asp">http://msdn.microsoft.com/en-us/library ... OT.10).asp">http://msdn.microsoft.com/en-us/library/cc245847(PROT.10).asp

An LPCSTR is a 32-bit pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters.

An LPCWSTR is a 32-bit pointer to a constant string of 16-bit UNICODE characters, which MAY be null-terminated.

The LPWSTR type and its alias PWSTR specifies a pointer to a sequence of UNICODE characters, which MAY be terminated by a null character (usually referred to as "null-terminated Unicode").

after reading that i now know i am dealing with a 32bit pointer pointing at something that might have a null terminator or it may not and could be 2x longer.
#4
newLISP and the O.S. /
February 10, 2009, 05:48:52 PM
quick question. In the above code. the import line in the generated file looks like this(import AutoItX3_dll "AU3_CDTrayLPCWSTR")
 then header file line looks like so AU3_API long WINAPI AU3_CDTray(LPCWSTR szDrive, LPCWSTR szAction);
 The "LPCWSTR" doesnt belong there, where would the edit go to fix the name in your script?



I think ill learn more from your script than all of my fiddling around.
#5
newLISP and the O.S. /
February 09, 2009, 05:47:43 PM
Thank you. This will be a  nice challenge.
#6
newLISP and the O.S. /
February 08, 2009, 02:11:41 PM
ok so the dll from autoit3 is an activex dll then and cant be imported.

looks lits possible to make a regular dll with what they have provided though.
#7
newLISP and the O.S. /
February 06, 2009, 04:43:01 PM
seems the dll mentioned above was a custom job.
#8
newLISP and the O.S. /
February 06, 2009, 01:40:45 PM
i did, i did search some.  now that i out in just autoit i see a ton more. feeling like a dope now. off to do some reading
#9
I sure it is. I'm also pretty sure I'm doing something wrong.



I tried a couple of the examples of importing functions into newlisp with the autoitx3.dll that is installed with autoit and Im not really getting any results, well any good ones.



The functions are all defined in the help files for autoit. There is much (almost nothing) about C that i don't understand though.
#10
newLISP in the real world /
January 31, 2009, 09:09:08 PM
i want to do this but dont see how.



if I find string1 and string2 println



I'm not getting the and relationship in the right place.





edit. got it. dropped a ")"
#11
newLISP in the real world /
January 31, 2009, 05:10:33 PM
thanks. what i want to do is this.

I want to find several strings grouped by "Job:"

    for example string1 to srting5

I will always find "Job:"

I will find 0 to 5 of the other strings.

at the next Job: repeat



I have a list of several jobs and i want to pull out several items and group them by job. seems simple enough. just haven't wrapped my brain around the lispy details yet.



Im not sure how to next the secondary string searches, break on the next "Job:' an still keep my position in the file.

Im thinking about just reading it in. at most it would be a couple of megs.



edit. your snipit is a big help. I think i see where i can nest the other finds.
#12
newLISP in the real world / Help me understand please.
January 31, 2009, 01:17:23 PM

;Original copy/past from codepatterns
;(dolist (file-name (3 (main-args)))              
;    (set 'file (open file-name "read"))          
;    (println "file ---> " file-name)            
;    (while (read-line file)                      
;        (if (find (main-args 2) (current-line) 0)
;        (write-line)))                          
;    (close file))                                
;                                                
;(exit)                                          
;
;some small edits by me. and one error on purpose
(set 'file-name "h:/output.txt")
(dolist (filename (3 (main-args)))              
    (set 'file (open file-name "read"))          
    (println "file ---> " file-name)            
    (while (read-line file)                      
        ;(if (find (main-args 2) (current-line) 0)
        (if (find "Job:" (current-line) 0)
        (write-line)))
    (close file)
)


OK, I found this snip of code on the Code Patterns page.

It seems perfect for a start to a tiny project i want to do.

For my convenience i didn't want to type a file name every time. I looked and thought that by replaceing the (3 (main-args)) with the name of the file, in quotes. it would work.

I did sorta manage to get something to work but I'm not getting why it did not work.



I do see what the (3 (main-args)) statement does. Just not what happens at the next level up/out at the file-name.



I misspelled the symbol in the second section to because i could not get rid of it with out getting a ERR: symbol is protected in function dolist : set error.



edit:

    1 more question the (current-line) its apparent what it does, it return the current line. but im not seeing why?

is it part of the FIND ? or some other function?



edit2:

    Ok I kept looking up functions and i now see that "file-name" was/is the variable for theloop. It was expecting a list and i wasn't giving it one.
#13
Anything else we might add? / small error in docs
January 19, 2009, 04:48:44 PM
In http://www.newlisp.org/CodePatterns.html">http://www.newlisp.org/CodePatterns.html





Many built-in functions when returning a list or array or an element belonging to a list or array referenced by a symbol, return a reference to the list – not a copy. This can be used to nest buil-in functions when modifying a list:

    ^    

a dropped T in that paragraph just above the: section.



7. Program flow
#14
newLISP Graphics & Sound /
January 19, 2009, 01:13:39 PM
wow! Google indexed the pages very quickly. i would not have thought it would be so quick.
#15
newLISP Graphics & Sound /
January 18, 2009, 06:01:06 PM
just in case you missed it. i edited my last post to say i found the trouble and the original guiserver.lsp now works like a champ.