Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 950745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:37:03+00:00 2026-05-15T23:37:03+00:00

In some documentation, Ruby’s Win32API has ‘L’ and ‘N’ to specify a number… and

  • 0

In some documentation, Ruby’s Win32API has 'L' and 'N' to specify a “number”… and in some documentation, 'L' is “long”. Is 'N' deprecated, and isn’t 'L' the same as 'I' actually? A “number” is somewhat not so specific.

In
http://rubyforge.org/docman/view.php/85/3463/API.html#M000001

There is no specifying a boolean parameter as 'B' or 'I', only the return value…

In
http://www.ruby-doc.org/stdlib/libdoc/Win32API/rdoc/classes/Win32/Registry/Error.html#M001622

There is

 Win32API.new('kernel32.dll', 'FormatMessageA', 'LPLLPLP', 'L')

instead of the more common ['L', 'P', 'L', ...] format

hWnd is 'L' and therefore 'I' will work too? (hWnd is handle to window)

Boolean parameter is 'B' and is the same as 'I'?

So basically, we can use most things as 'I'? Even the 'P' should be a 4-byte, so 'I' should work as well? Is there a more formal specification?

Update: now that I think more about 'P', it actually will use a Ruby’s String class object, and take the content buffer part and pass it into the C function. So using 'I' probably won’t trigger this behavior. (example: such as using GetWindowText())

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:37:04+00:00Added an answer on May 15, 2026 at 11:37 pm

    I’m looking at the win32-api source code, and it looks like the only difference between ‘L’ and ‘I’ is that ‘L’ calls rb_num2ulong and ‘I’ calls rb_num2int in <ruby.h>. So I guess the only difference is treatment as a signed value or not. ‘P’ also results rb_num2ulong, but it follows additional logic so I would probably stick to what the documentation suggests. I coudln’t find any mention of ‘N’ in the latest version of win32-api (1.4.5), so it’s probably deprecated. The Windows APIs do not return boolean, but some return BOOL which is (surprise! ) an int. In short, I don’t think you should use ‘I’ for everything. The win32-api documentation is pretty scant from what I’ve seen. At least the source code is available for browsing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody know some nice documentation about the ruby handsoap gem to get me
Using Ruby, I'm trying to parse some documentation in which I need to split
What's the best Ruby documentation resource? Some things I'm looking for: Offline Easy to
I am learning Ruby and found this code sample in some documentation: require 'find'
I read in some Microsoft documentation that PHP, together with Ruby on Rails, is
Possible Duplicate: Ruby functions vs methods Im just reading some ruby documentation and t
I am writing some documentation and I have a little vocabulary problem: http://www.example.com/en/public/img/logo.gif is
I create some documentation in the Trac wiki. I set these pages to all
I'm looking for some documentation on how Information Retrieval systems (e.g., Lucene) store their
When reading some documentation about assertions, I found: java -ea -dsa Enables assertions in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.