Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #12074 > unrolled thread
| Started by | "R.Wieser" <address@not.available> |
|---|---|
| First post | 2019-04-16 10:22 +0200 |
| Last post | 2019-04-21 15:13 +0200 |
| Articles | 20 on this page of 21 — 3 participants |
Back to article view | Back to microsoft.public.scripting.vbscript
CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "R.Wieser" <address@not.available> - 2019-04-16 10:22 +0200
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "Mayayana" <mayayana@invalid.nospam> - 2019-04-16 08:22 -0400
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "R.Wieser" <address@not.available> - 2019-04-16 14:53 +0200
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "Mayayana" <mayayana@invalid.nospam> - 2019-04-16 09:11 -0400
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "R.Wieser" <address@not.available> - 2019-04-16 17:43 +0200
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) JJ <jj4public@vfemail.net> - 2019-04-17 13:29 +0700
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "R.Wieser" <address@not.available> - 2019-04-17 10:35 +0200
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) JJ <jj4public@vfemail.net> - 2019-04-18 09:24 +0700
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "R.Wieser" <address@not.available> - 2019-04-18 08:56 +0200
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "Mayayana" <mayayana@invalid.nospam> - 2019-04-18 08:35 -0400
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "Mayayana" <mayayana@invalid.nospam> - 2019-04-18 10:25 -0400
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "R.Wieser" <address@not.available> - 2019-04-18 18:50 +0200
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) JJ <jj4public@vfemail.net> - 2019-04-19 12:32 +0700
Re: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) "R.Wieser" <address@not.available> - 2019-04-19 08:04 +0200
Dictionary oddity (was: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle)) JJ <jj4public@vfemail.net> - 2019-04-20 22:37 +0700
Re: Dictionary oddity (was: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle)) "Mayayana" <mayayana@invalid.nospam> - 2019-04-20 12:22 -0400
Re: Dictionary oddity (was: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle)) "R.Wieser" <address@not.available> - 2019-04-20 20:02 +0200
Re: Dictionary oddity JJ <jj4public@vfemail.net> - 2019-04-21 18:33 +0700
Re: Dictionary oddity (was: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle)) "R.Wieser" <address@not.available> - 2019-04-20 19:34 +0200
Re: Dictionary oddity JJ <jj4public@vfemail.net> - 2019-04-21 18:55 +0700
Re: Dictionary oddity "R.Wieser" <address@not.available> - 2019-04-21 15:13 +0200
Page 1 of 2 [1] 2 Next page →
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-16 10:22 +0200 |
| Subject | CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle) |
| Message-ID | <q943oc$kiv$1@gioia.aioe.org> |
Hello all, I'm creating a shortcut to cmd.exe, and would like to have the "Command Prompt Properties" -> "Options" -> "Full screen" (radio button) selected . Is there any way I can do that with the CreateShortcut object ? I've tried to google the solution, but for some reason "VBScript CreateShortcut CMD.EXE fullscreen" (or variations on it) doesn't give any related info back. I (ofcourse) did find the "WindowStyle" property, but it gets overruled by the above setting. :-| The targetted OS is XP pro. Remark: After starting the command-prompt I'm using the (DOS) MODE command to make it truly fullscreen (and not some half-assed window). Regards, Rudy Wieser P.s. An(y )other method to script the the above setting is ofcourse welcome too. :-)
[toc] | [next] | [standalone]
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Date | 2019-04-16 08:22 -0400 |
| Message-ID | <q94hi7$auo$1@dont-email.me> |
| In reply to | #12074 |
"R.Wieser" <address@not.available> wrote | | I'm creating a shortcut to cmd.exe, and would like to have the "Command | Prompt Properties" -> "Options" -> "Full screen" (radio button) selected . | Is there any way I can do that with the CreateShortcut object ? | You can't set program options in a shortcut. WSH is giving you the options that Windows has for IShellLink. Interestingly, I set it up, from the Start Menu, to have a small window, a white background, and brown text. (I figured if I have to sometimes use command line I could at least have it readable and not looking like a computer from a 1960 movie.) The interesting part is that if I use that shortcut I get my settings but if I double-click cmd.exe I don't. So I'd suggest making the shortcut, making you adjustments when opened from there, then using that shortcut. It seems to create the shortcut differently, as though it were a DOS shortcut.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-16 14:53 +0200 |
| Message-ID | <q94j8j$thd$1@gioia.aioe.org> |
| In reply to | #12075 |
Mayayana, > You can't set program options in a shortcut. That is what I found too, but hoped that I was wrong and just didn't have all the info. > The interesting part is that if I use that shortcut I get > my settings but if I double-click cmd.exe I don't. Thats easy to explain: When the shortcut (with its extra options) is started it (most likely) uses CreateProcess, supplying it with a STARTUPINFO record with the preferences filled in (from those program-shortcut settings). When you start cmd directly you get a STARTUPINFO record with the OS defaults. > So I'd suggest making the shortcut, making you adjustments > when opened from there, :-) That last part is what I was trying to circumvent (I'm trying to create a one-click default setup). > It seems to create the shortcut differently, as though it were > a DOS shortcut. It is. Most likely in response to the subsystem field in the executables PE header. Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Date | 2019-04-16 09:11 -0400 |
| Message-ID | <q94kcu$s1i$1@dont-email.me> |
| In reply to | #12076 |
"R.Wieser" <address@not.available> wrote | > So I'd suggest making the shortcut, making you adjustments | > when opened from there, | | :-) That last part is what I was trying to circumvent (I'm trying to create | a one-click default setup). | What I meant is that if you open from that shortcut, then make adjustments, the shortcut itself will remember them. It seems to be part of these DOS-esque shortcuts. Likewise, if you right-click -> Properties you'll see all of those options in the shortcut, which are not in a normal shortcut. You can then choose your options from there. In other words, cmd.exe has it's own special kind of shortcut.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-16 17:43 +0200 |
| Message-ID | <q94t6k$clv$1@gioia.aioe.org> |
| In reply to | #12077 |
Mayayana, > What I meant is that if you open from that shortcut, > then make adjustments, the shortcut itself will remember > them. Yes, I know you ment that. The thing is that I'm trying to be extemely lazy, and have the 'puter do it for me. > Likewise, if you right-click -> Properties you'll see all of > those options in the shortcut, which are not in a normal > shortcut. Remember that I, in my initial message, pointed out the exact setting I wanted to apply ? :-) Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2019-04-17 13:29 +0700 |
| Message-ID | <15wfltoi321aw.1mu2g2082zaym$.dlg@40tude.net> |
| In reply to | #12074 |
On Tue, 16 Apr 2019 10:22:55 +0200, R.Wieser wrote: > Hello all, > > I'm creating a shortcut to cmd.exe, and would like to have the "Command > Prompt Properties" -> "Options" -> "Full screen" (radio button) selected . > Is there any way I can do that with the CreateShortcut object ? > > I've tried to google the solution, but for some reason "VBScript > CreateShortcut CMD.EXE fullscreen" (or variations on it) doesn't give any > related info back. > > I (ofcourse) did find the "WindowStyle" property, but it gets overruled by > the above setting. :-| > > The targetted OS is XP pro. > > Remark: After starting the command-prompt I'm using the (DOS) MODE command > to make it truly fullscreen (and not some half-assed window). > > Regards, > Rudy Wieser > > P.s. > An(y )other method to script the the above setting is ofcourse welcome too. > :-) Not programmatically possible using VBScript, because the API is a COM interface IShellLinkDataList. It's not accessible from VBScript. You'll have to use PowerShell to access it.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-17 10:35 +0200 |
| Message-ID | <q96ofv$jd3$1@gioia.aioe.org> |
| In reply to | #12079 |
JJ, > Not programmatically possible using VBScript, because the API is > a COM interface IShellLinkDataList. Odd. I can use CreateShortcut to create and alter it, but some of its attributes remain inaccessible. Oh well. I just did a google for "VBScript IShellLinkDataList". Don't you just hate it when even the first page has results which do not even contain the words you're looking for. I know I do. :-( > It's not accessible from VBScript. You'll have to use PowerShell to > access it. ??? /what/ powershell ? This is Sparta^wXP ! :-) Though while doing the above search I came across one which mentioned that setting a "run as administrator" just needed the flipping of one bit in the .lnk file, which made me realize I could most likely do the same. Alas, although I think I found the byte it looks like that its not at a fixed location (even copying the origional .lnk file to a new location and changing the setting caused it to change its size), meaning that the file needs to be parsed. Assuming I can access the file in a binary fashion that is. I'll probably take a look at it, just not now. :-) Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2019-04-18 09:24 +0700 |
| Message-ID | <ix0f8eayditt$.nynhug80474v.dlg@40tude.net> |
| In reply to | #12080 |
On Wed, 17 Apr 2019 10:35:02 +0200, R.Wieser wrote: > > I just did a google for "VBScript IShellLinkDataList". Don't you just hate > it when even the first page has results which do not even contain the words > you're looking for. I know I do. :-( That would be Google. I'm sure of it. Only Google does that. Try using verbatim search. > ??? /what/ powershell ? This is Sparta^wXP ! :-) For XP, PowerShell has to be downloaded separately. And only for the older version. IIRC, newer versions of PowerShell won't run on XP. > Though while doing the above search I came across one which mentioned that > setting a "run as administrator" just needed the flipping of one bit in the > ..lnk file, which made me realize I could most likely do the same. > > Alas, although I think I found the byte it looks like that its not at a > fixed location (even copying the origional .lnk file to a new location and > changing the setting caused it to change its size), meaning that the file > needs to be parsed. Assuming I can access the file in a binary fashion > that is. > > I'll probably take a look at it, just not now. :-) > > Regards, > Rudy Wieser You can do that too, but you'll have to at least parse the layout of the shortcut file data structure, in order to get to the location of the extra data part. You can use VBScript's ASCII mode (text) stream to do binary file reading/editing.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-18 08:56 +0200 |
| Message-ID | <q99737$1l9v$1@gioia.aioe.org> |
| In reply to | #12081 |
JJ, > For XP, PowerShell has to be downloaded separately. That would be a problem .... You see, I'm still busy with putting a one-click basic configuration together - to be used directly after XP has been installed from CD, meaning with no extras available. And I'm not even sure if I want to /install/ PowerShell for this one-off action ... > You can use VBScript's ASCII mode (text) stream to > do binary file reading/editing. Are you sure ? Some time ago I tried to use the ReadAll method (trying to read a double-byte character textfile so I could convert it into ASCII), and got rather puzzeled by the returned contents. It turned out that although the method returned a string the size of the file, it only filled it partially (IIRC it stopped on encountering a certain character) which left the remainder with whatever was in memory at that time (it didn't even zero the buffer out!). Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Date | 2019-04-18 08:35 -0400 |
| Message-ID | <q99r2k$u4b$1@dont-email.me> |
| In reply to | #12082 |
"R.Wieser" <address@not.available> wrote | And I'm not even sure if I want to /install/ PowerShell for this one-off | action ... | Microsoft have pushed it for years now. So far I have yet to find something I need it for. You'd like it. It's all command line applets, like DOS, meant to lure Linux server managers to Windows. Though I think th fan base is mostly IT people -- corporate admins who can pass around specialized scripts. | > You can use VBScript's ASCII mode (text) stream to | > do binary file reading/editing. | | Are you sure ? Some time ago I tried to use the ReadAll method (trying to | read a double-byte character textfile so I could convert it into ASCII), and | got rather puzzeled by the returned contents. It turned out that although | the method returned a string the size of the file, it only filled it | partially (IIRC it stopped on encountering a certain character) which left | the remainder with whatever was in memory at that time (it didn't even zero | the buffer out!). | It stops at nulls. Here's the solution: https://www.jsware.net/jsware/scrfiles.php5#bints Things to know: ReadAll stops at the first null, assuming it's an end-of-file marker. Textstream is intended to only be used for text. The WSH planners assumed scripters wouldn't need or know about binary. So the results are pre- digested. An ANSI string is interpreted according to the local codepage. (I dont' know why they call it ASCII. It's ANSI.) The class above provides workarounds. It will work on any computer with a non-Asian codepage. (Japan, China and Korea use a system that doesn't have a character-to- byte correspondence.) The class can read unicode and leave in the nulls, as asterisks, or not. It can also handle binary data. For English, every second byte is a null and every first byte is the ASCII character, up to 127, so in English the unicode format is superfluous. There's also the other option. Is it ADODB.Stream? I'm not sure. I've rarely used it so I'm not really familiar with the methods or the Windows version support.
[toc] | [prev] | [next] | [standalone]
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Date | 2019-04-18 10:25 -0400 |
| Message-ID | <q9a1gu$4ej$1@dont-email.me> |
| In reply to | #12083 |
One follow-up note on that last post: If you don't need PowerShell it's just as well, for security's sake. PS has become a favorite exploit.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-18 18:50 +0200 |
| Message-ID | <q9a9s0$pnc$1@gioia.aioe.org> |
| In reply to | #12083 |
Mayayana, > Microsoft have pushed it for years now. Which is actually a signal for me to stay away from it. For some strange reason (WGA, W10 pushing, forced telemetry, forced updates, etc) I do not trust them too much anymore :-) > It stops at nulls. Yep, that was it. Funny though, as "read" doesn't have a problem with it. But that was not even the biggest thing with it. What was was that it returned /much/ more data than that it actually read /and/ that it didn't even bother to zero-out the remainder (before, or afterwards). If it would have been written by a student he would have flunked the assignment. > Here's the solution: Yep. He also uses the "how big is the file ? Do a 'read' with that size" instead (just took a quick peek). > The WSH planners assumed scripters wouldn't need or > know about binary. Most likely, yes. It seems to be aimed at text-based stuff only. On the other hand, its makes it rather easy to pull another component into the script, which than can do whatever you want. I think I've got a bit of a love-hate relationship with it ... > If you don't need PowerShell it's just as well, for security's > sake. PS has become a favorite exploit. That might have lingered in the back of my mind too. Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2019-04-19 12:32 +0700 |
| Message-ID | <1760mnafxodj7$.1sxig0kye2772.dlg@40tude.net> |
| In reply to | #12082 |
On Thu, 18 Apr 2019 08:56:30 +0200, R.Wieser wrote: > > That would be a problem .... > > You see, I'm still busy with putting a one-click basic configuration > together - to be used directly after XP has been installed from CD, meaning > with no extras available. > > And I'm not even sure if I want to /install/ PowerShell for this one-off > action ... I wouldn't use PowerShell either, unless it's absolutely needed. However in this case, it's the only scripting application by Microsoft which can access OLE/COM. If third party is fine, then there are AutoHotkey and AutoIt. > Are you sure ? Some time ago I tried to use the ReadAll method (trying to > read a double-byte character textfile so I could convert it into ASCII), and > got rather puzzeled by the returned contents. It turned out that although > the method returned a string the size of the file, it only filled it > partially (IIRC it stopped on encountering a certain character) which left > the remainder with whatever was in memory at that time (it didn't even zero > the buffer out!). You'll have to use Read(), Skip(), or Write(), instead of XXXLine() and XXXAll(). i.e. specify the exact number of bytes you want to read/skip/write.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-19 08:04 +0200 |
| Message-ID | <q9boet$12c9$1@gioia.aioe.org> |
| In reply to | #12086 |
JJ, > If third party is fine, then there are AutoHotkey and AutoIt. I did try AutoIt when the need to actually go thru configuration dialogs arose (as changing the registry didn't work for QuickLaunch). Alas, when I tried to click a ... treeview item (IIRC) I noticed it would try to click the center of the item, even if that item would not be visible, and sometimes not even within the confines of the dialog. In short: using a blind click which could hit /anything/. :-( That was whe I started trying to make my own "clicker" program (non-mouse. Direct control manipulation) ... and discovered that that is not half as easy as it looks. :-( :-) So, currently I use that "clicker" program to activate classic mode and enable QuickLaunch, and try to do the rest with registry changes (using VBScript). In other words, I'm my own "third party" now, with a program that doesn't need to be installed. :-) > You'll have to use Read(), Skip(), or Write(), instead of XXXLine() > and XXXAll(). i.e. specify the exact number of bytes you want to > read/skip/write. Yup. And hope I will not run into another of those "we do not like binary data" gotcha's ... Regards, Rudy Wieser p.s. Did you know that when you ask a dictionary object for the data of a non-existing key it will add that key (without data) ? Funny when you see such a dictionary grow when all you have been doing is querying it ...
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2019-04-20 22:37 +0700 |
| Subject | Dictionary oddity (was: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle)) |
| Message-ID | <1dvew6dhwc99d$.8yr2jbwh5vsg.dlg@40tude.net> |
| In reply to | #12087 |
On Fri, 19 Apr 2019 08:04:58 +0200, R.Wieser wrote: > > p.s. > Did you know that when you ask a dictionary object for the data of a > non-existing key it will add that key (without data) ? Funny when you see > such a dictionary grow when all you have been doing is querying it ... I rarely use dictionary, but it does work uncommonly. Even though MSDN mentioned it clearly that it will create the key if it doesn't yet exist, it will surely caught some experienced programmers by surprise. I wonder if this behaviour is the same for VBA's built in dictionary object, if such thing exist.
[toc] | [prev] | [next] | [standalone]
| From | "Mayayana" <mayayana@invalid.nospam> |
|---|---|
| Date | 2019-04-20 12:22 -0400 |
| Subject | Re: Dictionary oddity (was: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle)) |
| Message-ID | <q9fh34$h7m$1@dont-email.me> |
| In reply to | #12088 |
"JJ" <jj4public@vfemail.net> wrote | > Did you know that when you ask a dictionary object for the data of a | > non-existing key it will add that key (without data) ? Funny when you see | > such a dictionary grow when all you have been doing is querying it ... | | I rarely use dictionary, but it does work uncommonly. Even though MSDN | mentioned it clearly that it will create the key if it doesn't yet exist, it | will surely caught some experienced programmers by surprise. | I've never noticed that problem. Why would anyone check the value of a key without knowing it exists? There is an Exists method, but even that shouldn't normally be necessary. | I wonder if this behaviour is the same for VBA's built in dictionary object, | if such thing exist. The VB Dictionary is coming from scrrun.dll. I love Dictionaries. The author of the O'Reilly VB book pointed out that they're much faster than Collections, which I rarely use. But I stick to VBS for Dictionary use because the scrrun dependency in VB can be a problem and it's not designed for native code efficiency. Really, saying that VB has FileSystemObject and Dictionary is just a sleight of hand. VB doesn't have those. It's just able to use scrrun and a lot of people decided to pretend VB and VBS are the same thing. When I want something similar in VB I write classes that store arrays. But in VBS I find Dictionaries a great way to store loads of complexly related data.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-20 20:02 +0200 |
| Subject | Re: Dictionary oddity (was: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle)) |
| Message-ID | <q9fmsm$j30$2@gioia.aioe.org> |
| In reply to | #12089 |
Mayayana, > Why would anyone check the value of a key without > knowing it exists? Because its a two-in-one step: if the result is not-empty I use it, if not I know I need to do something in relation with the key, store the result and use it. In short, a cache. But thats something else thats rather odd: The dictionary doesn't throw an error when the key doesn't exist. Instead it returns a null. I know that it does away with having to use "exists" beforehand, but whats the logic in that ? In short, what where the people thinking when they purposely wrote the method that way ? > There is an Exists method, but even that shouldn't normally > be necessary. :-) How than do you know whats (already) in there ? Normally I do not exactly know what the file contains my code is trawling thru, and certainly will not gamble on those contents being perfect. > When I want something similar in VB I write classes that > store arrays. Static arrays are very costly when you want to add a record. Mind you, I've used VBScript on a 256 MByte (yes, Mega) Win98 machine. It payed off to be a bit carefull with what you did memore wise. Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2019-04-21 18:33 +0700 |
| Subject | Re: Dictionary oddity |
| Message-ID | <lq1gd2yn559f.19g3bwsisphu1.dlg@40tude.net> |
| In reply to | #12089 |
On Sat, 20 Apr 2019 12:22:10 -0400, Mayayana wrote: > > The VB Dictionary is coming from scrrun.dll. That's the same as VBS, then. :(
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2019-04-20 19:34 +0200 |
| Subject | Re: Dictionary oddity (was: CreateShortcut on cmd.exe - how to set fullscreen mode ? (not WindowStyle)) |
| Message-ID | <q9fmsm$j30$1@gioia.aioe.org> |
| In reply to | #12088 |
JJ, > I rarely use dictionary, but it does work uncommonly. I'll say! Querying something /never/ should have side effects like this. I can't even think of a good reason to have it behave that way. And mind you: the method has specifically written to do it that way (I partially disassembled the dictionary object), its not some side effect of something deep-down below. > Even though MSDN mentioned it clearly that it will create > the key if it doesn't yet exist I just checked and indeed saw it mentioned quite clearly. Can't remember if I also did when I first found that quirk (on my W98se machine). > it will surely caught some experienced programmers by surprise. :-) It did. (not that I'm /that/ experienced mind you - just a long track record) And by the way: due to that "feature" the "exists" method is either a mockery, or must be used every time you want to do a query - or suffer the dictionary to grow. Regards. Rudy Wieser
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2019-04-21 18:55 +0700 |
| Subject | Re: Dictionary oddity |
| Message-ID | <mzfjl91iwg5e.1mmkvtkas7sn0.dlg@40tude.net> |
| In reply to | #12090 |
On Sat, 20 Apr 2019 19:34:19 +0200, R.Wieser wrote: > > :-) It did. (not that I'm /that/ experienced mind you - just a long track > record) Well, I think any non-beginner programmers would know that a query is a read-only operation. When the object doesn't exist, the operation shouldn't write anything to the object being queried. I mean... what object? Right? It just doesn't make sense. The Dictionary object's description in MSDN states that "A Dictionary object is the equivalent of a PERL associative array". So, anyone who's familiar with PERL can confirm? i.e. Does querying a non existing associative array element causes the element to be created? I do have PERL reserved in my system, so I might test this myself. But I'm pretty positive that PERL doesn't have such oddity.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | microsoft.public.scripting.vbscript
csiph-web